- java.lang.Object
-
- eu.ess.xaos.core.util.ZoneIDHolder
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatterDATE_TIME_FORMATTER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZoneIDHoldergetInstance()ZoneIdgetZoneID()voidsetZoneID(ZoneId zoneID)static DatetoDate(long milliseconds)static DatetoDate(Instant instant)static InstanttoInstant(long milliseconds)static InstanttoInstant(Date date)StringtoString(long milliseconds)StringtoString(Instant instant)StringtoString(Date date)StringtoUTCString(long milliseconds)StringtoUTCString(Instant instant)StringtoUTCString(Date date)booleanupdateSystemDateAndTime(String serverDateTime)Sets the date of a Linux machine to the given one.
-
-
-
Field Detail
-
DATE_TIME_FORMATTER
public static final DateTimeFormatter DATE_TIME_FORMATTER
-
-
Method Detail
-
getInstance
public static ZoneIDHolder getInstance()
-
toDate
public static Date toDate(long milliseconds)
- Parameters:
milliseconds- The milliseconds from the Java epoch of 1970-01-01T00:00:00Z.- Returns:
- A new
Dateobject 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
Instantobject built using the given parameter.
-
getZoneID
public ZoneId getZoneID()
-
setZoneID
public void setZoneID(ZoneId zoneID)
-
toString
public String toString(long milliseconds)
-
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 bydatecommand.- Returns:
trueid the operation succeeded.
-
-