combine.date.and.time {M3}R Documentation

Combine date and time to obtain date-time in POSIX format

Description

Combine date and time to obtain date-time in POSIX format

Usage

combine.date.and.time(date, time)

Arguments

date

Date in Date format or as character string in format “YYYY-MM-DD”.

time

Time as list with hours (hrs), minutes (mins), and seconds (secs) components or as character string in format HH:MM:SS (with hours ranging from 00-23).

Value

A date-time in R's POSIX class.

Note

This function is called by get.datetime.seq, get.M3.var, and var.subset, but it will probably not be called by most users.

Author(s)

Jenise Swall

See Also

DateTimeClasses, strptime

Examples

## This function can accept dates as a character string:
combine.date.and.time(date="2011-05-03", time="16:15:30")

## Or, the dates can be in R's Date format.
combine.date.and.time(date=as.Date("2011-05-03"), time="16:15:30")

## The time can also be given as a list:
combine.date.and.time(date="2011-05-03", time=list(hrs=16, mins=15, secs=30))

[Package M3 version 0.4 Index]