I cannot get duration (in days) to work between two dates Date1 and Date 2.
list Date1: 23mar2021 04:00:00
I changed the format of date1 and dat2 from %tc to %td.
then gen vent_days = date2 - date1
i get vent_days: 2.21e+07
Date2: 1.91e+12
Date1: 1.91e+12
Now sure how I am getting numbers so high they are exponential? The number of days between these dates should be between 1 and 30-ish.
As an update: I realize this is because there are times. So if I have a variable that includes the times not just the date, how do I use state to computer duration?
list Date1: 23mar2021 04:00:00
I changed the format of date1 and dat2 from %tc to %td.
then gen vent_days = date2 - date1
i get vent_days: 2.21e+07
Date2: 1.91e+12
Date1: 1.91e+12
Now sure how I am getting numbers so high they are exponential? The number of days between these dates should be between 1 and 30-ish.
As an update: I realize this is because there are times. So if I have a variable that includes the times not just the date, how do I use state to computer duration?
Comment