datatable.time.hour()

Added in version 1.0.0

Retrieve the “hour” component of a time64 column. The returned value will always be in the range [0; 23].

Parameters

time
FExpr[time64]

A column for which you want to compute the hour part.

return
FExpr[int32]

The hour part of the source column.

Examples

from datetime import datetime as d DT = dt.Frame([d(2020, 5, 11, 12, 0, 0), d(2021, 6, 14, 16, 10, 59, 394873)]) DT[:, {'time': f[0], 'hour': dt.time.hour(f[0])}]
timehour
time64int32
02020-05-11T12:00:00 12
12021-06-14T16:10:59.39487316

See Also

  • minute() – retrieve the “minute” component of a timestamp

  • second() – retrieve the “second” component of a timestamp

  • nanosecond() – retrieve the “nanosecond” component of a timestamp