datatable.time.year()

Added in version 1.0.0

Retrieve the “year” component of a date32 or time64 column.

Parameters

date
FExpr[date32] | FExpr[time64]

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

return
FExpr[int32]

The year part of the source column.

Examples

DT = dt.Frame([1, 1000, 100000], stype='date32') DT[:, {'date': f[0], 'year': dt.time.year(f[0])}]
dateyear
date32int32
01970-01-021970
11972-09-271972
22243-10-172243

See Also

  • month() – retrieve the “month” component of a date

  • day() – retrieve the “day” component of a date