Class TimeInfo

java.lang.Object
org.jtool.jxplatform.builder.TimeInfo

public class TimeInfo extends Object
Manages time information.
  • Method Details

    • getCurrentTime

      public static ZonedDateTime getCurrentTime()
      Returns an ZonedDateTime 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

      public static long getTimeAsLong(ZonedDateTime time)
      Returns the number of seconds corresponding to given time information.
      Parameters:
      time - the ZonedDateTime object
      Returns:
      the number of seconds from 1970-01-01T00:00:00Z
    • getTimeAsISOString

      public static String getTimeAsISOString(ZonedDateTime time)
      Returns the ISO-formatted string for given time information.
      Parameters:
      time - the ZonedDateTime object
      Returns:
      the formatted string
    • getFormatedTime

      public static String getFormatedTime(ZonedDateTime time)
      Returns the formatted string of the time for given time information.
      Parameters:
      time - the ZonedDateTime object
      Returns:
      the formatted string
    • getFormatedDate

      public static String getFormatedDate(ZonedDateTime time)
      Returns the formatted string of the date for given time information.
      Parameters:
      time - the ZonedDateTime object
      Returns:
      the formatted string
    • getTime

      public static ZonedDateTime getTime(String str)
      Returns an ZonedDateTime object obtained from a given string.
      Parameters:
      str - the string that represents the time
      Returns:
      the ZonedDateTime object
    • getTime

      public static ZonedDateTime getTime(long utime)
      Returns an ZonedDateTime object for a given number of seconds.
      Parameters:
      utime - the number of seconds from 1970-01-01T00:00:00Z
      Returns:
      the ZonedDateTime object