Convert from one time zone to another.

DESCRIPTION:

Takes a time/date object, and converts it from one time zone to another.

USAGE:

timeConvert(x, to.zone, from.zone)

REQUIRED ARGUMENTS:

x
Time/date object to convert.
to.zone
Time zone to convert to (character)
from.zone
Time zone to convert from (character) -- for timeDate objects, this is ignored, and instead is taken from the time.zone slot of the timeDate object.

VALUE:

Time/date object with converted zone.

DETAILS:

The timeDate stores times/dates as their equivalent time in GMT, with a time zone (used for printing and other operations) stored in the time.zone slot. Therefore, to convert time zones, this function simply puts the new time zone into the time.zone slot. On the other hand, big-data time/date objects do not store a time zone. So, for these objects, this function actually converts the stored data from one time zone to another.

SEE ALSO:

.

EXAMPLES:

options(time.zone="GMT",
  time.in.format="%m/%d/%Y [%H:%M]",
  time.out.format="%m/%d/%Y %02H:%02M (%Z)")
date1 <- timeDate("3/22/2002 12:00", zone="PST")
date1 
# 3/22/2002 12:00 (PST)
date2 <- timeConvert(date1, "EST")
date2 # converted to EST
# 3/22/2002 15:00 (EST)