How to disable warning R: object time zone (UTC) is different from the current time zone ()

I keep getting this warning: timezone of object (UTC) is different than current timezone (). My current time zone is "EET", as shown by Sys.timezone() .

Is there a way to change the R timezone to UTC, instead of taking it from my system? Or disable the warning?

+4
source share
3 answers

Try the following:

 Sys.setenv(TZ = "UTC") 
+10
source

If you can get a local time zone, this is from:

  Sys.timezone() [1] "" # So in my case nothing there 

And no Sys.timezone () <- function

  Sys.time() [1] "2011-01-06 16:01:10 EST" 

But, obviously, there must be something. And here's how to convert to another time zone:

  strftime(Sys.time() , tz="UTC") [1] "2011-01-06 21:02:48" 

For further specific advice, it is possible that if you proposed dput () results for an object, we all will have access to any necessary attributes to answer other questions.

+1
source

If you are sure that your code works and other sources of warnings are unlikely, just put a call inside suppressWarnings ().

For instance,

 require(quantmod) getSymbols("FDX") suppressWarnings(chartSeries(FDX,theme="white")) 
+1
source

Source: https://habr.com/ru/post/1334558/


All Articles