- java.lang.Object
-
- eu.ess.xaos.core.util.ZoneIDHolder
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatter
DATE_TIME_FORMATTER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZoneIDHolder
getInstance()
ZoneId
getZoneID()
void
setZoneID(ZoneId zoneID)
static Date
toDate(long milliseconds)
static Date
toDate(Instant instant)
static Instant
toInstant(long milliseconds)
static Instant
toInstant(Date date)
String
toString(long milliseconds)
String
toString(Instant instant)
String
toString(Date date)
String
toUTCString(long milliseconds)
String
toUTCString(Instant instant)
String
toUTCString(Date date)
boolean
updateSystemDateAndTime(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
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.
-
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 bydate
command.- Returns:
true
id the operation succeeded.
-
-