Skip to content
Prev 377633 / 398502 Next

POSIXct format

Hi,

It is because the print method for POSIXct likely tries to simplify.  To see it in the format you desire, you need to be explicit when calling it.

x = as.POSIXct('2018-11-2700:00:00', format = "%Y-%m-%d%H:%M:%S", tz = 'UTC')
format(x, "%Y-%m-%d %H:%M:%S %Z")
[1] "2018-11-27 00:00:00 UTC"

Cheers,
Ben
Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecological Forecasting: https://eco.bigelow.org/