combine.date.and.time: Combine date and time to obtain date-time in POSIX format

Description Usage Arguments Value Note Author(s) See Also Examples

Description

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

Usage

1

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

1
2
3
4
5
6
7
8
## 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))

Example output

Loading required package: ncdf4
Loading required package: rgdal
Loading required package: sp
rgdal: version: 1.5-18, (SVN revision 1082)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.0.4, released 2020/01/28
Path to GDAL shared files: /usr/share/gdal
GDAL binary built with GEOS: TRUE 
Loaded PROJ runtime: Rel. 6.3.1, February 10th, 2020, [PJ_VERSION: 631]
Path to PROJ shared files: /usr/share/proj
Linking to sp version:1.4-4
To mute warnings of possible GDAL/OSR exportToProj4() degradation,
use options("rgdal_show_exportToProj4_warnings"="none") before loading rgdal.
Loading required package: maps
Loading required package: mapdata
[1] "2011-05-03 16:15:30 GMT"
[1] "2011-05-03 16:15:30 GMT"
[1] "2011-05-03 16:15:30 GMT"

M3 documentation built on May 2, 2019, 11:04 a.m.