The function Sys.Date()
returns a date object, but on different machines running R2.12 I get different outputs
> Sys.Date()
[1] "08/17/2011 00:00:00.000 UTC"
开发者_StackOverflowvs.
> Sys.Date()
[1] "2011-08-17"
The former looks like a POSIX object, even though it's still a date object. What possible differences in settings between the two environments may cause this problem?
Could it be that the systems are set to different locales? Try
Sys.getlocale();
Another possible scenario is that some nefarious soul "overwrote" the Sys.Date()
function with another. Try running
base::Sys.Date();
on both systems. If you have a package, other than base, that is loading a function called Sys.Date()
then you should call base::Sys.Date()
to be sure you get the right one.
精彩评论