my_datetime <- as.POSIXct("2020-02-02 02:20:02 UTC", tz = "UTC")
get_hour(my_datetime)
get_hour(my_datetime, -12)
get_date(my_datetime)
get_date(my_datetime, -12)
## This will return the original `my_date`
get_date(my_datetime) + get_hour(my_datetime)
## This will too
get_date(my_datetime, -12) + get_hour(my_datetime, -12)
Run the code above in your browser using DataLab