Package org.jtool.jxplatform.builder
Class TimeInfo
java.lang.Object
org.jtool.jxplatform.builder.TimeInfo
Manages time information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTime
Returns anZonedDateTime
object corresponding to the current time.static long
Returns the epoch second corresponding to the current time.static String
getFormatedDate
(ZonedDateTime time) Returns the formatted string of the date for given time information.static String
getFormatedTime
(ZonedDateTime time) Returns the formatted string of the time for given time information.static ZonedDateTime
getTime
(long utime) Returns anZonedDateTime
object for a given number of seconds.static ZonedDateTime
Returns anZonedDateTime
object obtained from a given string.static String
Returns the ISO-formatted string for given time information.static long
getTimeAsLong
(ZonedDateTime time) Returns the number of seconds corresponding to given time information.
-
Method Details
-
getCurrentTime
Returns anZonedDateTime
object corresponding to the current time.- Returns:
- the
ZonedDateTime
object
-
getCurrentTimeAsLong
public static long getCurrentTimeAsLong()Returns the epoch second corresponding to the current time.- Returns:
- the number of seconds from 1970-01-01T00:00:00Z
-
getTimeAsLong
Returns the number of seconds corresponding to given time information.- Parameters:
time
- theZonedDateTime
object- Returns:
- the number of seconds from 1970-01-01T00:00:00Z
-
getTimeAsISOString
Returns the ISO-formatted string for given time information.- Parameters:
time
- theZonedDateTime
object- Returns:
- the formatted string
-
getFormatedTime
Returns the formatted string of the time for given time information.- Parameters:
time
- theZonedDateTime
object- Returns:
- the formatted string
-
getFormatedDate
Returns the formatted string of the date for given time information.- Parameters:
time
- theZonedDateTime
object- Returns:
- the formatted string
-
getTime
Returns anZonedDateTime
object obtained from a given string.- Parameters:
str
- the string that represents the time- Returns:
- the
ZonedDateTime
object
-
getTime
Returns anZonedDateTime
object for a given number of seconds.- Parameters:
utime
- the number of seconds from 1970-01-01T00:00:00Z- Returns:
- the
ZonedDateTime
object
-