[R] is.na(strptime (...)) return TRUE on FreeBSD

Rasmus Liland jr@| @end|ng |rom po@teo@no
Fri May 12 12:16:28 CEST 2023


Hi!  I ran the code

	(d <- strptime("1970-01-01 12:00:00 UTC", "%Y-%m-%d %H:%M:%OS", tz = ""))
	is.na(d)
	dput(unclass(d))
	as.POSIXct(d)
	(d <- is.na(strptime("1970-01-03 12:00:00 UTC", "%Y-%m-%d %H:%M:%OS", tz = '')))
	is.na(d)
	dput(unclass(d))
	as.POSIXct(d)

on «R 4.2.3-1 on Linux 6.2.11-arch1-1» and
«R 4.1.0 on FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f,»
yielding the same result:

	[1] "1970-01-01 12:00:00 CET"
	[1] FALSE
	list(sec = 0, min = 0L, hour = 12L, mday = 1L, mon = 0L, year = 70L,
	    wday = 4L, yday = 0L, isdst = 0L, zone = "CET", gmtoff = NA_integer_)
	[1] "1970-01-01 12:00:00 CET"
	[1] FALSE
	[1] FALSE
	FALSE
	Error in as.POSIXct.default(d) :
	  do not know how to convert 'd' to class “POSIXct”
	Calls: as.POSIXct -> as.POSIXct.default
	Execution halted

Best,
Rasmus



More information about the R-help mailing list