directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Ayyagari <ayyagariki...@gmail.com>
Subject [SHARED-LDAP] new methods in DateUtils class
Date Sat, 08 Nov 2008 19:39:24 GMT
hi guys,

    I want to add two new methods to DateUtils class for getting the generalized
    time string in a convenient way when providing a Date object or time as a
    long value

    waiting for your view(s) before committing it

    they look like below mentioned code

     /**
      *
      * @see #getGeneralizedTime()
      *
      * @param date the date to be converted to generalized time string
      * @return given date in the generalized time string format
      */
     public static String getGeneralizedTime( Date date )
     {
         synchronized ( dateFormat )
         {
             return dateFormat.format( date );
         }
     }


     /**
      *
      * @see #getGeneralizedTime()
      *
      * @param time the time value to be converted to generalized time string
      * @return given time in generalized time string format
      */
     public static String getGeneralizedTime( long time )
     {
         return getGeneralizedTime( new Date( time ) );
     }

-- 
Kiran Ayyagari

Mime
View raw message