开发者

output format of Sys.Date()

开发者 https://www.devze.com 2023-03-28 23:39 出处:网络
The function Sys.Date() returns a date object, but on different machines running R2.12 I get different outputs

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"
开发者_StackOverflow

vs.

> 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消