timeinfo

timeinfo(time = Sys.time())

time2num(time, ...)

num2time(num, ...)

time2str(time)

time_round(time = Sys.time())

Arguments

time

POSIXct or time character, e.g. "1998-01-01 01:00:00"

num

difference of time to 1970-01-01 (in second), e.g. 1634365535.959902

Value

A data.table with the columns of:

  • year : int

  • month : int

  • day : int

  • hour : int

  • time : time character, e.g. "2021-10-16 14:25:35"

  • timenum : difference of time to 1970-01-01 (in second), e.g. 1634365535.959902

Examples

timeinfo()
#>     year month   day  hour             timestr    timenum
#>    <num> <num> <int> <int>              <char>      <int>
#> 1:  2025     1    27     7 2025-01-27 07:07:59 1737961679
time_round()
#> [1] "2025-01-27 07:00:00 UTC"