Package org.apache.directory.api.util
Class DateUtils
- java.lang.Object
-
- org.apache.directory.api.util.DateUtils
-
public final class DateUtils extends Object
Gets the generalized time using the "Z" form of the g-time-zone.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Date
convertIntervalDate(String intervalDate)
Converts the 18-digit Active Directory timestamps, also named 'Windows NT time format' or 'Win32 FILETIME or SYSTEMTIME'.static Date
getDate(String zuluTime)
Return a Date instance from a Stringstatic String
getGeneralizedTime()
Gets the generalized time right now.static String
getGeneralizedTime(long time)
static String
getGeneralizedTime(Date date)
-
-
-
Method Detail
-
getDate
public static Date getDate(String zuluTime)
Return a Date instance from a String- Parameters:
zuluTime
- The String to convert- Returns:
- The Date instance
-
getGeneralizedTime
public static String getGeneralizedTime()
Gets the generalized time right now.GeneralizedTime
- Returns:
- the generalizedTime right now
-
getGeneralizedTime
public static String getGeneralizedTime(Date date)
- Parameters:
date
- the date to be converted to generalized time string- Returns:
- given date in the generalized time string format
- See Also:
getGeneralizedTime()
-
getGeneralizedTime
public static String getGeneralizedTime(long time)
- Parameters:
time
- the time value to be converted to generalized time string- Returns:
- given time in generalized time string format
- See Also:
getGeneralizedTime()
-
convertIntervalDate
public static Date convertIntervalDate(String intervalDate) throws ParseException
Converts the 18-digit Active Directory timestamps, also named 'Windows NT time format' or 'Win32 FILETIME or SYSTEMTIME'. These are used in Microsoft Active Directory for pwdLastSet, accountExpires, LastLogon, LastLogonTimestamp and LastPwdSet. The timestamp is the number of 100-nanoseconds intervals (1 nanosecond = one billionth of a second) since Jan 1, 1601 UTC.- Parameters:
intervalDate
- 18-digit number. Time in 100-nanoseconds intervals since 1.1.1601- Returns:
- The converted date
- Throws:
ParseException
- If the given interval is not valid
-
-