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
I suggest that stdlib add a derived type for dates (three integer components of year, month, day) called date and for dates and times, called say date_time, which could have components matching the arguments of the date_and_time intrinsic subroutine. The functionality of date and date_time could be modeled after Python's datetime.date and datetime classes. For dates, Fortran's operator overloading can be useful, allowing dates to be compared with >, >= etc., dates to be subtracted (giving the number of days between them) and for an integer to be added or subtracted to a date (shifting the date by that many days forward or backward). There should be a function to get the day of week (integer from 1 through 7) from a date. Given a 1D array of dates, you should be able to subsample to get the first or last (or possibly nth) days of the month, quarter, or year.
The text was updated successfully, but these errors were encountered:
I suggest that stdlib add a derived type for dates (three integer components of year, month, day) called
date
and for dates and times, called saydate_time
, which could have components matching the arguments of thedate_and_time
intrinsic subroutine. The functionality ofdate
anddate_time
could be modeled after Python'sdatetime.date
anddatetime
classes. For dates, Fortran's operator overloading can be useful, allowing dates to be compared with>, >=
etc., dates to be subtracted (giving the number of days between them) and for an integer to be added or subtracted to a date (shifting the date by that many days forward or backward). There should be a function to get the day of week (integer from 1 through 7) from a date. Given a 1D array of dates, you should be able to subsample to get the first or last (or possibly nth) days of the month, quarter, or year.The text was updated successfully, but these errors were encountered: