Module xaos.core

Class ZoneIDHolder


  • public class ZoneIDHolder
    extends Object
    Holds the current ZoneId and provides methods to work with it.
    Author:
    claudio.rosati@esss.se
    • Method Detail

      • toDate

        public static Date toDate​(long milliseconds)
        Parameters:
        milliseconds - The milliseconds from the Java epoch of 1970-01-01T00:00:00Z.
        Returns:
        A new Date object built using the given parameter.
      • toDate

        public static Date toDate​(Instant instant)
        Parameters:
        instant - The Instant object to be converted.
        Returns:
        A new Date object built using the given parameter.
      • toInstant

        public static Instant toInstant​(long milliseconds)
        Parameters:
        milliseconds - The milliseconds from the Java epoch of 1970-01-01T00:00:00Z.
        Returns:
        A new Instant object built using the given parameter.
      • toInstant

        public static Instant toInstant​(Date date)
        Parameters:
        date - The Date object to be converted.
        Returns:
        A new Instant object built using the given parameter.
      • getZoneID

        public ZoneId getZoneID()
      • setZoneID

        public void setZoneID​(ZoneId zoneID)
      • toString

        public String toString​(Date date)
      • toString

        public String toString​(long milliseconds)
      • toUTCString

        public String toUTCString​(Date date)
      • toUTCString

        public String toUTCString​(long milliseconds)
      • updateSystemDateAndTime

        public boolean updateSystemDateAndTime​(String serverDateTime)
        Sets the date of a Linux machine to the given one.

        The following command will be used: date, hwclock, and /usr/local/sbin/rtc_set.

        Parameters:
        serverDateTime - The new date to be set. The format should be the one accepted by date command.
        Returns:
        true id the operation succeeded.