You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Qdate could benefit from more date arithmetic in the sense of finding out the difference between two dates.
difference_days(Date1, Date2) would return the number of days between those two dates.
difference_minutes(Date1, Date2) would do the same (though this is easy because of the easy conversion to unix timestamps - same with seconds (obviously), hours.
calculating differences of days with respect is more complicated if a range crosses a daylight savings time.
My gut is telling me that the answer to both is to strip off any time component and use just dates, then convert to gregorian days with calendar:date_to_gregorian_days(Date). From there, the math is simple. Maybe the time component could then be re-added to the original dates and the time component compared to retrieve the fractional part of a day with compared times.
Something to chew on.
The text was updated successfully, but these errors were encountered:
Qdate could benefit from more date arithmetic in the sense of finding out the difference between two dates.
difference_days(Date1, Date2) would return the number of days between those two dates.
difference_minutes(Date1, Date2) would do the same (though this is easy because of the easy conversion to unix timestamps - same with seconds (obviously), hours.
calculating differences of days with respect is more complicated if a range crosses a daylight savings time.
My gut is telling me that the answer to both is to strip off any time component and use just dates, then convert to gregorian days with calendar:date_to_gregorian_days(Date). From there, the math is simple. Maybe the time component could then be re-added to the original dates and the time component compared to retrieve the fractional part of a day with compared times.
Something to chew on.
The text was updated successfully, but these errors were encountered: