Skip to content

Date object and origin BC

1 message · Stefan Petersson

#
hi everybody,

is this intended behaviour?
[1] "0-01-01"
[1] "-1-01-01"
Error in charToDate(x) : 
character string is not in a standard unambiguous format

Is this a bug?

I found this, while trying to convert dates stored as 
"months since -2-01-01 00:00:00".
For the past I extracted this first_date string and converted my data
using 

dates <- as.Date(x, origin=as.Date(first_date))

But this fails with -2-01-01

Any ideas how to solve this? 

thanks and best regards,
 Stefan