From Ajay.Deonarine at aig.com  Fri May  5 14:24:30 2017
From: Ajay.Deonarine at aig.com (Deonarine, Ajay)
Date: Fri, 5 May 2017 12:24:30 +0000
Subject: [Rd] Possible bug in how POSIXct is printed
Message-ID: <E28F74B4F99F4F46804BCA91B0E7427628CE4B9B@PWGSMSLIVMBS02.mail.aig.net>

Greetings R-devel group.  When dealing with Inf dates, as.POSIXct seems to return Inf, but is printed as NA:

> x1 <- as.POSIXct(Inf, origin = '1970-01-01')
> print(x1)
[1] NA
> is.na(x1)
[1] FALSE
> is.infinite(x1)
[1] TRUE
>

POSIXlt at least evaluates and prints the result consistently:

> x1 <- as.POSIXlt(Inf, origin = '1970-01-01')
> print(x1)
[1] NA
> is.na(x1)
[1] TRUE
>

I think the cause is due to format.POSIXct function calling format.POSIXlt, hence printing as NA, but actually storing an Inf.  I don't have an opinion on what the actual result of as.POSIXct(Inf) should be, as long as what's printed matches that value.

Thank you

	[[alternative HTML version deleted]]



[Rd] Possible bug in how POSIXct is printed
Deonarine, Ajay