public class TimeUtils
extends java.lang.Object
Constructor and Description |
---|
TimeUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Long |
fromFormattedString(java.lang.String timeFormat,
java.lang.String timeString)
Get timestamp from a formatted time string, e.g.
|
static java.lang.String |
getTimeTag()
Generate a time tag of current timestamp, using the time format at `Globals.TimeConfig.defaultTimeFormat`.
|
static java.lang.Long |
now() |
static java.lang.String |
toFormattedString(long timestamp)
Format a timestamp to a string using the time format at `Globals.TimeConfig.defaultTimeFormat`.
|
static java.lang.String |
toFormattedString(java.lang.String timeFormat,
long timestamp)
Format a timestamp to a string using a time format.
|
public static java.lang.Long fromFormattedString(java.lang.String timeFormat, java.lang.String timeString)
timeFormat
- the format string of timetimeString
- the time stringpublic static java.lang.Long now()
public static java.lang.String getTimeTag()
public static java.lang.String toFormattedString(long timestamp)
timestamp
- the timestamp to formatpublic static java.lang.String toFormattedString(java.lang.String timeFormat, long timestamp)
timeFormat
- the time formattimestamp
- the timestamp to format