示例#1
0
        /*
         * Produces a string representation of the date in SQL format
         *
         * @return a string representation of the date in SQL format - {@code
         *         "yyyy-mm-dd"}.
         */
        public override String ToString()
        {
            java.util.Calendar c = new java.util.GregorianCalendar();
            c.setTimeInMillis(this.milliseconds);
            java.lang.StringBuilder sb = new java.lang.StringBuilder(10);

            format(c.get(java.util.Calendar.YEAR), 4, sb);
            sb.append('-');
            format(c.get(java.util.Calendar.MONTH + 1), 2, sb);
            sb.append('-');
            format(c.get(java.util.Calendar.DAY_OF_MONTH), 2, sb);

            return(sb.toString());
        }
示例#2
0
文件: Date.cs 项目: sailesh341/JavApi
        /**
         * Produces a string representation of the date in SQL format
         *
         * @return a string representation of the date in SQL format - {@code
         *         "yyyy-mm-dd"}.
         */
        public override String ToString()
        {
            java.util.Calendar c = new java.util.GregorianCalendar();
            c.setTimeInMillis(this.milliseconds);
            java.lang.StringBuilder sb = new java.lang.StringBuilder(10);

            format(c.get(java.util.Calendar.YEAR), 4, sb);
            sb.append('-');
            format(c.get(java.util.Calendar.MONTH + 1), 2, sb);
            sb.append('-');
            format(c.get(java.util.Calendar.DAY_OF_MONTH), 2, sb);

            return sb.toString();
        }
示例#3
0
 public virtual int getMinutes()
 {
     java.util.Calendar c = new java.util.GregorianCalendar();
     c.setTimeInMillis(this.milliseconds);
     return(c.get(java.util.Calendar.MINUTE));
 }
示例#4
0
 public virtual int getHours()
 {
     java.util.Calendar c = new java.util.GregorianCalendar();
     c.setTimeInMillis(this.milliseconds);
     return(c.get(java.util.Calendar.HOUR));
 }
示例#5
0
 public virtual int getYear()
 {
     java.util.Calendar c = new java.util.GregorianCalendar();
     c.setTimeInMillis(this.milliseconds);
     return(c.get(java.util.Calendar.YEAR) - 1900);
 }
示例#6
0
 public virtual int getDate()
 {
     java.util.Calendar c = new java.util.GregorianCalendar();
     c.setTimeInMillis(this.milliseconds);
     return(c.get(java.util.Calendar.DAY_OF_MONTH));
 }