directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r712474 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java
Date Sun, 09 Nov 2008 08:52:33 GMT
Author: kayyagari
Date: Sun Nov  9 00:52:32 2008
New Revision: 712474

URL: http://svn.apache.org/viewvc?rev=712474&view=rev
Log:
added two convenient methods

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java?rev=712474&r1=712473&r2=712474&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java
Sun Nov  9 00:52:32 2008
@@ -169,4 +169,34 @@
             return dateFormat.format( date );
         }
     }
+    
+    
+    /**
+     * 
+     * @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 ) );
+    }
+    
 }



Mime
View raw message