Package com.wibu.cm
Class CodeMeter.CMTIME
- java.lang.Object
-
- com.wibu.cm.CodeMeter.CMTIME
-
- Enclosing class:
- CodeMeter
public static class CodeMeter.CMTIME extends java.lang.ObjectCMTIME sets or gets the time to or from a CmContainer.Definition for the class CMTIME corresponding to the c-api struct CMTIME CMTIME sets or gets the time to or from a CmContainer.
-
-
Field Summary
Fields Modifier and Type Field Description shortdayspecifies the value of the day (1..31).shorthoursspecifies the value of the hours (0..23).shortminutesspecifies the value of the minutes (0..59).shortmonthspecifies the value of the month (1..12).shortsecondsspecifies the value of the seconds (0..59).longsecondsSince01_01_2000specifies the time in seconds since 01/01/2000 0:00:00 (UTC).shortyearspecifies the value of the year (e.g.
-
Constructor Summary
Constructors Constructor Description CMTIME()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanreadFrom(byte[] bcmtime)This methods reads data from a byte array in the native endian formatvoidrecalculateTimeInSeconds()This methods recalculates the secondsSince01_01_2000 member and must be called if any other of the CMTIME members has been set/modified.booleansetEpochTimeInSeconds(long secondsSince1970)Sets the new time using the seconds since 1.1.1970 (Epoch).booleansetTimeInSeconds(long secondsSince2000)Sets the new time using the seconds since 1.1.2000 (CodeMeter native format).java.lang.StringtoString()Return a string representing the current time.
-
-
-
Field Detail
-
year
public short year
specifies the value of the year (e.g. 2003).
-
month
public short month
specifies the value of the month (1..12).
-
day
public short day
specifies the value of the day (1..31).
-
hours
public short hours
specifies the value of the hours (0..23).
-
minutes
public short minutes
specifies the value of the minutes (0..59).
-
seconds
public short seconds
specifies the value of the seconds (0..59).
-
secondsSince01_01_2000
public long secondsSince01_01_2000
specifies the time in seconds since 01/01/2000 0:00:00 (UTC).
-
-
Method Detail
-
toString
public java.lang.String toString()
Return a string representing the current time. The format is fixed for all locales (WIBU format) and always UTC, e.g. "2009-07-15 13:54:12"- Overrides:
toStringin classjava.lang.Object
-
readFrom
public boolean readFrom(byte[] bcmtime)
This methods reads data from a byte array in the native endian format- Parameters:
bcmtime-- Returns:
- true on success.
-
setEpochTimeInSeconds
public boolean setEpochTimeInSeconds(long secondsSince1970)
Sets the new time using the seconds since 1.1.1970 (Epoch).- Parameters:
secondsSince1970- seconds since 1.1.1970, must be positive value
-
setTimeInSeconds
public boolean setTimeInSeconds(long secondsSince2000)
Sets the new time using the seconds since 1.1.2000 (CodeMeter native format).- Parameters:
secondsSince2000- seconds since 1.1.2000, must be positive value
-
recalculateTimeInSeconds
public void recalculateTimeInSeconds()
This methods recalculates the secondsSince01_01_2000 member and must be called if any other of the CMTIME members has been set/modified.
-
-