I am having problem with converting objects into xts objects and it looks to have something to do with time zone.

It looks that it has something to do with my computer settings and I am wondering whether someone has seen this and solved it or the best practice is to just setting to "GMT"?

Also, what is the default behavior if the Time Zone is unknown, defaulting to "GMT" already?

Thanks, Wang


Sys.getenv("TZ")
       TZ
"est5edt"
> Sys.timezone()
[1] "EST"
> z<- as.POSIXlt(Sys.time())
> attributes(z)
$names
[1] "sec"   "min"   "hour"  "mday"  "mon"   "year"  "wday"  "yday"  "isdst"

$class
[1] "POSIXt"  "POSIXlt"

$tzone
[1] ""    "EST" "EDT"

data(sample_matrix)
sample.xts <- as.xts(sample_matrix, descr='my new xts object')

Warning messages:
1: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"),  :
  unknown timezone '_st5edt'
2: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"),  :
  unknown timezone '_st5edt'
3: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"),  :
  unknown timezone '_st5edt'
4: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"),  :
  unknown timezone '_st5edt'
5: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"),  :
  unknown timezone '_st5edt'

class(sample.xts)
[1] "xts" "zoo"
> str(sample.xts)
An 'xts' object from 2007-01-02 to 2007-06-30 containing:
  Data: num [1:180, 1:4] 50 50.2 50.4 50.4 50.2 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:4] "Open" "High" "Low" "Close"
  Indexed by objects of class: [POSIXt,POSIXct]
   Original class: 'matrix'
  xts Attributes:
List of 1
 $ descr: chr "my new xts object"
>>> This e-mail and any attachments are confidential, may contain legal,
professional or other privileged information, and are intended solely for the
addressee.  If you are not the intended recipient, do not use the information
in this e-mail in any way, delete this e-mail and notify the sender. CEG-IP2

	[[alternative HTML version deleted]]

