sys::Obj sys::Virtual sys::Component sys::Service datetime::DateTimeService
public class DateTimeService
DateTimeService is used to manage the system clock. It also stores the current time which is automatically updated each second.
public property byte day
Day of month
public property byte dayOfWeek
Day of week (see also datetime::DayOfWeek)
protected inline DateTime dt
public property byte hour
Hour, adjusted for UTC offset
public long lastRefreshTicks
public static const define Log log
public property byte minute
Minute
public property byte month
Month of year (see also datetime::Month)
public property long nanos [unit="nanosecond"]
Nanos since epoch
public property bool osUtcOffset [config]
If true, then the utcOffset is controlled by the operating system. If false then the utcOffset is configured strictly by Sedona.
public property byte second
Second
public inline property Buf tz [asStr, config, max=32]
Olsen timezone identifier such as "America/New_York". This property is purely extra informational meta-data to help tools interpret the utcOffset property.
public property int utcOffset [config, unit="second"]
Current UTC offset in seconds used to calculate the time fields from nanos. If osUtcOffset is true this is a read-only property read from the operating system. If osUtcOffset is false then this is a configuration property.
public property int year
Year
public virtual int getUtcOffset()
Return the current UTC offset in seconds, including adjustment for daylight savings time if necessary
public virtual long now()
Return the current UTC date/time on the system in nanoseconds, or
DateTime.invalid if not supported, i.e. platform does not have clock capability
public action void refresh()
Refreshes all property fields with current value
protected virtual void setClock(long nanos)
Set the system clock to the given UTC value. May
not be supported on all platform.
public action void setSysClock(long nanos)
Sets the system clock and refreshes properties. May not
be supported on all properties
public virtual override void start()
Callback when component first started
protected void updateProperties(long n)
Update the property fields with values stored in dt
public virtual override bool work()
Perform a chunk of background work. Return true is there is pending work or false if the Service is done working this cycle.