Main Content

Elapsed time since midnight for `datetime`

arrays

returns a `T`

= timeofday(`DT`

)`duration`

array whose values equal the elapsed time
since midnight for each element in `DT`

.

For `datetime`

arrays without time zones, and in most other
cases, `T`

is equal
to

E = hours(DT.Hour) + minutes(DT.Minute) + seconds(DT.Second)

If `DT`

has its `TimeZone`

property set to a
time zone that respects Daylight Saving Time (DST), then
`timeofday`

takes DST into account. For more information, see
Algorithms.

The output argument `T`

is also equivalent to ```
DT -
dateshift(DT,'start','day')
```

.

A `datetime`

array can have its `TimeZone`

property
set to a time zone that observes Daylight Saving Time (DST). The
`timeofday`

function takes DST into account.

If the input argument

`DT`

is a`datetime`

array with no time zone, then the output`T`

is also equal toE = hours(DT.Hour) + minutes(DT.Minute) + seconds(DT.Second)

If

`DT`

has its`TimeZone`

property set to a time zone that does not observe DST, then`T`

is equal to`E`

.If

`DT`

has its`TimeZone`

property set to a time zone that observes DST, then`timeofday`

accounts for the DST shift on days when the shift occurs. On those days, for times after the DST shift occurs,`T`

differs from`E`

by the amount of the shift.