# datetime::DateTimeService

    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.

day

  `public property byte day`

  Day of month

dayOfWeek

  `public property byte dayOfWeek`

  Day of week (see also datetime::DayOfWeek)

dt

  `protected inline DateTime dt`

hour

  `public property byte hour`

  Hour, adjusted for UTC offset

lastRefreshTicks

  `public long lastRefreshTicks`

log

  `public static const define Log log`

minute

  `public property byte minute`

  Minute

month

  `public property byte month`

  Month of year (see also datetime::Month)

nanos

  `public property long nanos [unit="nanosecond"]`

  Nanos since epoch

osUtcOffset

  `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.

second

  `public property byte second`

  Second

tz

  `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.

utcOffset

  `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.

year

  `public property int year`

  Year

getUtcOffset

  `public virtual int getUtcOffset()`

  Return the current UTC offset in seconds, including adjustment for daylight savings time if necessary

now

  `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

refresh

  `public action void refresh()`

  Refreshes all property fields with current value

setClock

  `protected virtual void setClock(long nanos)`

  Set the system clock to the given UTC value. May

       not be supported on all platform.

setSysClock

  `public action void setSysClock(long nanos)`

  Sets the system clock and refreshes properties. May not

       be supported on all properties

start

  `public virtual override void start()`

  Callback when component first started

updateProperties

  `protected void updateProperties(long n)`

  Update the property fields with values stored in dt

work

  `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.