Closed aphalo closed 8 years ago
Mix up of use of ymd() and ymd_hms() in my code. It just happened to work earlier!
The argument is tz
. If you pass tzone="UTC"
"UTC" will be parsed as date.
Mixing ymd
and ymd_hmd
should be working as expected (at least with lubridate). Most of base and lubridate date-time functionality is generic. The advantage or returning Date from ymd is that you won't get confused with time zones during date-time manipulation.
Thanks! Code is working, and conceptually I am representing times. The error was caused because at some places in my code the logic tests whether the value supplied is of class time or not. I just submitted an update to my 'photobiology' package that also should "cure" the NOTEs triggered by other of my packages. Thanks for your help!
For consistency the code below should return a time NA instead of a date NA, as
class(lubridate::ymd(NA_character_)
apparently returned in the previous version.I can fix package 'photobiology' by generating a suitable NA, with the code below, but this looks to me as a bug in 'lubridate'.