| shide-arithmetic {shide} | R Documentation | 
Arithmetic operations for jdate and jdatetime
Description
Arithmetic operations for jdate and jdatetime
Usage
## S3 method for class 'jdate'
vec_arith(op, x, y, ...)
## S3 method for class 'jdatetime'
vec_arith(op, x, y, ...)
Arguments
op | 
 An arithmetic operator as a string.  | 
x, y | 
 A pair of vectors.  | 
... | 
 These dots are for future extensions and must be empty.  | 
Details
Supported operations:
Difference between two
jdateobjects results adifftimeobject withunits = "days".Difference between two
jdatetimeobjects results adifftimeobject withunits = "seconds".A numeric vector can be added to or subtracted from a
jdateorjdatetime.A
difftimevector can be added to or subtracted from ajdateonly if it has resolution bigger than "days".A
difftimevector can be added to or subtracted from ajdatetime.A
jdateobject can be subtracted from ajdatetimeand vice versa.
Value
The binary operator result of x and y. See
details for more information on operator behaviors.
Examples
jdatetime_now() - jdate_now()
jdate_now() - as.difftime(1, units ="weeks" ) - as.difftime(1, units = "days")