difftime_dtc: Time Differences for Date/Time Objects

Description Usage Arguments Details Value Author(s)

Description

This function takes two date-time objects, with or without date separator, and estimates the time difference between them.

Usage

1
difftime_dtc(date1, date2, units, tz, as.real)

Arguments

date1

A date, a character string in date-time format.

date2

A second date, a character string in date-time format.

units

Units for calculation, defaults to hours.

tz

Time-zone, defaults to "UTC".

as.real

Boolean; should result be returned as a real number?

Details

The function allows for date-time objects of class character or POSIXct/POSIXlt; it will convert either or both inputs to POSIX-compliant objects as required.

The result is returned as a numerical difference (real number), or as a difftime object.

Value

Either a numeric value corresponding to the time difference between the inputs, or a difftime object.

Author(s)

Ryan Kyle, ryan.kyle@mail.mcgill.ca


rpkyle/cscmisc documentation built on May 13, 2019, 12:06 p.m.