Elapsed time since midnight for datetimes
d = timeofday(
returns an array of
durations equal to the elapsed time since midnight for each of the
t
)datetime
values in t
. The output argument,
d
, is equal to the result of t -
dateshift(t,'start','day')
, and is the same size as
t
.
If you have datetime
values with no time zone, then
d
also is equal
to
e = hours(t.Hour) + minutes(t.Minute) + seconds(t.Second)
If a datetime
value has its TimeZone
property set to a time zone that does not observe Daylight Saving Time
(DST), then d
is equal to e
.
If a datetime
value 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,
d
differs from e
by the amount of
the shift.