Package toxi.util
Class DateUtils
java.lang.Object
toxi.util.DateUtils
A Simple timestamp generator/formatter with timezone support.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final String
Creates a formatted timestamp string of the current datetime using the local host timezone.static final String
timeStamp
(long t) Creates a formatted timestamp string of the given epoch using the local host timezone.static final String
Creates a formatted timestamp string of the given date using the local host timezone.static final String
Creates a formatted timestamp string of the given date using the specified timezone.static final String
timeStampForZone
(String zoneID, Date date) Creates a formatted timestamp string of the given date using the given timezone ID.static final String
Creates a formatted timestamp string of the current date in GMT.static final String
timeStampGMT
(long t) Creates a formatted timestamp string of the given epoch in GMT.static final String
timeStampGMT
(Date date) Creates a formatted timestamp string of the given date in GMT.
-
Field Details
-
GMT
-
FORMAT
-
-
Constructor Details
-
DateUtils
public DateUtils()
-
-
Method Details
-
timeStamp
Creates a formatted timestamp string of the current datetime using the local host timezone.- Returns:
- timestamp
-
timeStamp
Creates a formatted timestamp string of the given date using the local host timezone.- Parameters:
date
-- Returns:
- timestamp
-
timeStamp
Creates a formatted timestamp string of the given date using the specified timezone.- Parameters:
date
-zone
-- Returns:
- timestamp
-
timeStamp
Creates a formatted timestamp string of the given epoch using the local host timezone.- Parameters:
t
- unix epoch timestamp- Returns:
- timestamp
-
timeStampForZone
Creates a formatted timestamp string of the given date using the given timezone ID.- Parameters:
zoneID
-date
-- Returns:
- timestamp
- See Also:
-
timeStampGMT
Creates a formatted timestamp string of the current date in GMT.- Returns:
- timestamp
-
timeStampGMT
Creates a formatted timestamp string of the given date in GMT.- Returns:
- timestamp
-
timeStampGMT
Creates a formatted timestamp string of the given epoch in GMT.- Returns:
- timestamp
-