Constructor Function for timeDate Objects

DESCRIPTION:

Construct a timeDate object from a character vector, a vector of julian days, or a vector of milliseconds, or construct an empty timeDate object.

USAGE:

 
timeDate(charvec, in.format=<<see below>>, 
         format=<<see below>>, zone=<<see below>>, 
         julian, ms, in.origin=c(month=1, day=1, year=1960)) 

REQUIRED ARGUMENTS:

One of charvec, julian, or ms must be supplied, unless the function is called with no arguments.

OPTIONAL ARGUMENTS:

charvec
character vector to read the times from.
in.format
input format string for charvec. The default value is options("time.in.format"). Click on class.timeDate in the SEE ALSO section below for the list of allowable input format strings.
format
output format stored in result. The default is options("time.out.format").
zone
time zone stored in result. The default value is options("time.zone").
julian
integer vector of number of days since in.origin. If ms is missing, this argument can also be a numeric whose fractional part gives the fraction of the day.
ms
integer vector of milliseconds since midnight.
in.origin
origin for the julian argument. This should be a vector with month, day, and year components.

VALUE:

a timeDate object derived from the inputs.

DETAILS:

If charvec is given, times are read from its character strings using the format string from in.format. This conversion uses the time zone supplied in zone. If charvec is not supplied, then julian and/or ms are used to construct the time vector; these are copied directly to the internals of the time object without considering the time zone (i.e. they must be given in GMT, or the user must call timeZoneConvert afterwards). Leap seconds will not cause NA values, but may cause times of day to be off by a second in the days that contain them.

For information about possible values for the in.format and format arguments, see the documentation for the timeDate class ( ).

SEE ALSO:

, , , .

EXAMPLES:

timeDate() 
timeDate(c("1/1/97", "2/1/97", "mar 1, 1997")) 
timeDate(c("1 PM", "2 PM", "3 AM"), in.format = "%H %p",  
      format = "%I %p") 
timeDate(julian = 36, ms = 876393,  
      in.origin = c(month=1,day=1,year=1998)) 

## Get today's date in yyyymmdd format
timeDate(date(), in.format="%w %m %d %H:%M:%S %Z %Y",
      format="%Y%02m%02d")