Package toxi.util
Class DateUtils
java.lang.Object
toxi.util.DateUtils
A Simple timestamp generator/formatter with timezone support.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringCreates a formatted timestamp string of the current datetime using the local host timezone.static final StringtimeStamp(long t) Creates a formatted timestamp string of the given epoch using the local host timezone.static final StringCreates a formatted timestamp string of the given date using the local host timezone.static final StringCreates a formatted timestamp string of the given date using the specified timezone.static final StringtimeStampForZone(String zoneID, Date date) Creates a formatted timestamp string of the given date using the given timezone ID.static final StringCreates a formatted timestamp string of the current date in GMT.static final StringtimeStampGMT(long t) Creates a formatted timestamp string of the given epoch in GMT.static final StringtimeStampGMT(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
-