Format 1: diffyear()
Format 2: diffyear()
Format 3: diffmonth()
Format 4: diffmonth()
Format 5: diffday()
Format 6: diffday()
Format 7: diffhour()
Format 8: diffhour()
Format 9: diffminute()
Format 10: diffminute()
Format 11: diffsecond()
Format 12: diffsecond()
Compute the interval between two dates or time such as (
) and
(
), where the interval is measured in terms of months, days, hours, minutes, seconds. Fractions are rounded up.
Compute the number of months during the period between the value in the date column and September 1, 2013.
$ more dat1.csv id,date 1,19641010 2,20000101 3, 4,19770812 $ mcal c='diffmonth($d{date},0d20130901)' a=rsl i=dat1.csv o=rsl1.csv #END# kgcal a=rsl c=diffmonth($d{date},0d20130901) i=dat1.csv o=rsl1.csv $ more rsl1.csv id,date,rsl 1,19641010,-587 2,20000101,-164 3,, 4,19770812,-433
Compute the minutes between the value in the time column and January 1, 2012 00 hours 00 minutes 00 seconds.
$ more dat2.csv id,time 1,20120101000000 2,20120101011112 3, 4,20111231235000 $ mcal c='diffmonth($t{time},0t20120101000000)' a=rsl i=dat2.csv o=rsl2.csv #END# kgcal a=rsl c=diffmonth($t{time},0t20120101000000) i=dat2.csv o=rsl2.csv $ more rsl2.csv id,time,rsl 1,20120101000000,0 2,20120101011112,0 3,, 4,20111231235000,-1