19 use,
intrinsic :: iso_c_binding, only: c_char, c_int
35 integer(kind=c_int) :: tm_sec
36 integer(kind=c_int) :: tm_min
37 integer(kind=c_int) :: tm_hour
38 integer(kind=c_int) :: tm_mday
39 integer(kind=c_int) :: tm_mon
40 integer(kind=c_int) :: tm_year
41 integer(kind=c_int) :: tm_wday
42 integer(kind=c_int) :: tm_yday
43 integer(kind=c_int) :: tm_isdst
54 bind(c, name=
'strftime') result(rc)
60 import :: c_char, c_int
66 character(kind=c_char),
dimension(*),
intent(out) :: str
67 integer(kind=c_int),
value,
intent(in) :: slen
68 character(kind=c_char),
dimension(*),
intent(in) :: format
70 integer(kind=c_int) :: rc
74 function c_strptime(str, format, tm) bind(c, name='strptime')
result(rc)
80 import :: c_char, c_int
86 character(kind=c_char),
dimension(*),
intent(in) :: str
87 character(kind=c_char),
dimension(*),
intent(in) :: format
89 integer(kind=c_int) :: rc
111 use,
intrinsic :: iso_fortran_env, only: real32, real64
117 public ::
zero,
one,
d2h,
h2d,
d2m,
m2d,
m2h,
s2d,
d2s,
h2s,
s2h,
m2s,
s2m,
maxstrlen 119 real(kind=real64),
parameter ::
zero = 0_real64
120 real(kind=real64),
parameter ::
one = 1_real64
124 real(kind=real64),
parameter ::
d2h = 24_real64
126 real(kind=real64),
parameter ::
d2m =
d2h*60_real64
128 real(kind=real64),
parameter ::
m2h =
one/60_real64
129 real(kind=real64),
parameter ::
s2d =
m2d/60_real64
130 real(kind=real64),
parameter ::
d2s = 86400_real64
131 real(kind=real64),
parameter ::
h2s = 3600_real64
133 real(kind=real64),
parameter ::
m2s = 60_real64
158 use,
intrinsic :: iso_fortran_env, only: real32, real64
175 integer :: minutes = 0
176 integer :: seconds = 0
177 integer :: milliseconds = 0
182 procedure, pass(self),
public :: getDays
183 procedure, pass(self),
public :: getHours
184 procedure, pass(self),
public :: getMinutes
185 procedure, pass(self),
public :: getSeconds
186 procedure, pass(self),
public :: getMilliseconds
189 procedure,
public :: total_seconds
192 procedure,
private :: timedelta_plus_timedelta
193 procedure,
private :: timedelta_minus_timedelta
194 procedure,
private :: unary_minus_timedelta
195 procedure,
private :: eq
196 procedure,
private :: neq
197 procedure,
private :: gt
198 procedure,
private :: ge
199 procedure,
private :: lt
200 procedure,
private :: le
202 generic ::
operator(+) => timedelta_plus_timedelta
203 generic ::
operator(-) => timedelta_minus_timedelta, &
204 unary_minus_timedelta
205 generic ::
operator(==) => eq
206 generic ::
operator(/=) => neq
207 generic ::
operator(>) => gt
208 generic ::
operator(>=) => ge
209 generic ::
operator(<) => lt
210 generic ::
operator(<=) => le
221 pure elemental type(
timedelta) function timedelta_constructor(days, &
222 hours, minutes, seconds, milliseconds)
226 integer,
intent(in),
optional :: days
227 integer,
intent(in),
optional :: hours
228 integer,
intent(in),
optional :: minutes
229 integer,
intent(in),
optional :: seconds
230 integer,
intent(in),
optional :: milliseconds
232 if (
present(days))
then 233 timedelta_constructor%days = days
235 timedelta_constructor%days = 0
238 if (
present(hours))
then 239 timedelta_constructor%hours = hours
241 timedelta_constructor%hours = 0
244 if (
present(minutes))
then 245 timedelta_constructor%minutes = minutes
247 timedelta_constructor%minutes = 0
250 if (
present(seconds))
then 251 timedelta_constructor%seconds = seconds
253 timedelta_constructor%seconds = 0
256 if (
present(milliseconds))
then 257 timedelta_constructor%milliseconds = milliseconds
259 timedelta_constructor%milliseconds = 0
267 pure elemental integer function getdays(self)
273 pure elemental integer function gethours(self)
279 pure elemental integer function getminutes(self)
285 pure elemental integer function getseconds(self)
297 pure elemental real(kind=real64) function total_seconds(self)
305 + self%hours*3600._real64 &
306 + self%minutes*60._real64 &
308 + self%milliseconds*1e-3_real64
322 hours=t0%hours + t1%hours, &
323 minutes=t0%minutes + t1%minutes, &
324 seconds=t0%seconds + t1%seconds, &
325 milliseconds=t0%milliseconds + t1%milliseconds)
352 t%minutes = -t0%minutes
353 t%seconds = -t0%seconds
354 t%milliseconds = -t0%milliseconds
358 pure elemental logical function eq(td0, td1)
367 eq = td0%total_seconds() == td1%total_seconds()
371 pure elemental logical function neq(td0, td1)
380 neq = .not. (td0%total_seconds() == td1%total_seconds())
384 pure elemental logical function gt(td0, td1)
393 gt = td0%total_seconds() > td1%total_seconds()
397 pure elemental logical function ge(td0, td1)
406 ge = td0%total_seconds() >= td1%total_seconds()
410 pure elemental logical function lt(td0, td1)
419 lt = td0%total_seconds() < td1%total_seconds()
423 pure elemental logical function le(td0, td1)
432 le = td0%total_seconds() <= td1%total_seconds()
455 use,
intrinsic :: iso_fortran_env, only: real32, real64
456 use,
intrinsic :: iso_c_binding, only: c_char, c_int, c_null_char
485 integer :: minute = 0
486 integer :: second = 0
487 integer :: millisecond = 0
489 real(kind=real64) :: tz = 0
494 procedure, pass(self),
public :: getYear
495 procedure, pass(self),
public :: getMonth
496 procedure, pass(self),
public :: getDay
497 procedure, pass(self),
public :: getHour
498 procedure, pass(self),
public :: getMinute
499 procedure, pass(self),
public :: getSecond
500 procedure, pass(self),
public :: getMillisecond
501 procedure, pass(self),
public :: getTz
504 procedure, pass(self),
public :: isocalendar
505 procedure, pass(self),
public :: isoformat
506 procedure, pass(self),
public :: isValid
507 procedure,
nopass,
public :: now
508 procedure, pass(self),
public :: secondsSinceEpoch
509 procedure, pass(self),
public :: strftime
510 procedure, pass(self),
public :: tm
511 procedure, pass(self),
public :: tzOffset
512 procedure, pass(self),
public :: utc
513 procedure, pass(self),
public :: weekday
514 procedure, pass(self),
public :: isoweekday
515 procedure, pass(self),
public :: weekdayLong
516 procedure, pass(self),
public :: isoweekdayLong
517 procedure, pass(self),
public :: weekdayShort
518 procedure, pass(self),
public :: isoweekdayShort
519 procedure, pass(self),
public :: yearday
522 procedure, pass(self),
private :: addMilliseconds
523 procedure, pass(self),
private :: addSeconds
524 procedure, pass(self),
private :: addMinutes
525 procedure, pass(self),
private :: addHours
526 procedure, pass(self),
private :: addDays
529 procedure, pass(d0),
private :: datetime_plus_timedelta
530 procedure, pass(d0),
private :: timedelta_plus_datetime
531 procedure, pass(d0),
private :: datetime_minus_datetime
532 procedure, pass(d0),
private :: datetime_minus_timedelta
533 procedure, pass(d0),
private :: eq
534 procedure, pass(d0),
private :: neq
535 procedure, pass(d0),
private :: gt
536 procedure, pass(d0),
private :: ge
537 procedure, pass(d0),
private :: lt
538 procedure, pass(d0),
private :: le
540 generic ::
operator(+) => datetime_plus_timedelta, &
541 timedelta_plus_datetime
542 generic ::
operator(-) => datetime_minus_datetime, &
543 datetime_minus_timedelta
544 generic ::
operator(==) => eq
545 generic ::
operator(/=) => neq
546 generic ::
operator(>) => gt
547 generic ::
operator(>=) => ge
548 generic ::
operator(<) => lt
549 generic ::
operator(<=) => le
560 pure elemental type(
datetime) function datetime_constructor(year, month, &
561 day, hour, minute, second, millisecond, tz)
565 integer,
intent(in),
optional :: year
566 integer,
intent(in),
optional :: month
567 integer,
intent(in),
optional :: day
568 integer,
intent(in),
optional :: hour
569 integer,
intent(in),
optional :: minute
570 integer,
intent(in),
optional :: second
571 integer,
intent(in),
optional :: millisecond
572 real(kind=real64),
intent(in),
optional :: tz
574 if (
present(year))
then 575 datetime_constructor%year = year
577 datetime_constructor%year = 1
580 if (
present(month))
then 581 datetime_constructor%month = month
583 datetime_constructor%month = 1
586 if (
present(day))
then 587 datetime_constructor%day = day
589 datetime_constructor%day = 1
592 if (
present(hour))
then 593 datetime_constructor%hour = hour
595 datetime_constructor%hour = 0
598 if (
present(minute))
then 599 datetime_constructor%minute = minute
601 datetime_constructor%minute = 0
604 if (
present(second))
then 605 datetime_constructor%second = second
607 datetime_constructor%second = 0
610 if (
present(millisecond))
then 611 datetime_constructor%millisecond = millisecond
613 datetime_constructor%millisecond = 0
616 if (
present(tz))
then 617 datetime_constructor%tz = tz
619 datetime_constructor%tz = 0
627 pure elemental integer function getyear(self)
633 pure elemental integer function getmonth(self)
639 pure elemental integer function getday(self)
645 pure elemental integer function gethour(self)
651 pure elemental integer function getminute(self)
657 pure elemental integer function getsecond(self)
669 pure elemental real(kind=real64) function gettz(self)
680 class(
datetime),
intent(inout) :: self
681 integer,
intent(in) :: ms
683 self%millisecond = self%millisecond + ms
686 if (self%millisecond >= 1000)
then 687 call self%addSeconds(self%millisecond/1000)
688 self%millisecond = mod(self%millisecond, 1000)
689 elseif (self%millisecond < 0)
then 690 call self%addSeconds(self%millisecond/1000 - 1)
691 self%millisecond = mod(self%millisecond, 1000) + 1000
707 class(
datetime),
intent(inout) :: self
708 integer,
intent(in) :: s
710 self%second = self%second + s
713 if (self%second >= 60)
then 714 call self%addMinutes(self%second/60)
715 self%second = mod(self%second, 60)
716 elseif (self%second < 0)
then 717 call self%addMinutes(self%second/60 - 1)
718 self%second = mod(self%second, 60) + 60
731 class(
datetime),
intent(inout) :: self
732 integer,
intent(in) :: m
734 self%minute = self%minute + m
737 if (self%minute >= 60)
then 738 call self%addHours(self%minute/60)
739 self%minute = mod(self%minute, 60)
740 elseif (self%minute < 0)
then 741 call self%addHours(self%minute/60 - 1)
742 self%minute = mod(self%minute, 60) + 60
750 pure elemental subroutine addhours(self, h)
755 class(
datetime),
intent(inout) :: self
756 integer,
intent(in) :: h
758 self%hour = self%hour + h
761 if (self%hour >= 24)
then 762 call self%addDays(self%hour/24)
763 self%hour = mod(self%hour, 24)
764 elseif (self%hour < 0)
then 765 call self%addDays(self%hour/24 - 1)
766 self%hour = mod(self%hour, 24) + 24
774 pure elemental subroutine adddays(self, d)
779 class(
datetime),
intent(inout) :: self
780 integer,
intent(in) :: d
782 integer :: daysInCurrentMonth
784 self%day = self%day + d
786 daysincurrentmonth =
daysinmonth(self%month, self%year)
787 if (self%day > daysincurrentmonth)
then 788 self%day = self%day - daysincurrentmonth
789 self%month = self%month + 1
790 if (self%month > 12)
then 791 self%year = self%year + self%month/12
792 self%month = mod(self%month, 12)
794 elseif (self%day < 1)
then 795 self%month = self%month - 1
796 if (self%month < 1)
then 797 self%year = self%year + self%month/12 - 1
798 self%month = 12 + mod(self%month, 12)
800 self%day = self%day +
daysinmonth(self%month, self%year)
808 pure elemental character(len=23) function isoformat(self, sep)
813 character(len=1),
intent(in),
optional :: sep
816 character(len=1) :: separator
818 if (
present(sep))
then 831 int2str(self%month, 2)//
'-'// &
832 int2str(self%day, 2)//separator// &
834 int2str(self%minute, 2)//
':'// &
835 int2str(self%second, 2)//
'.'// &
840 pure elemental logical function isvalid(self)
851 if (self%year < 1)
then 856 if (self%month < 1 .or. self%month > 12)
then 861 if (self%day < 1 .or. &
862 self%day >
daysinmonth(self%month, self%year))
then 867 if (self%hour < 0 .or. self%hour > 23)
then 872 if (self%minute < 0 .or. self%minute > 59)
then 877 if (self%second < 0 .or. self%second > 59)
then 882 if (self%millisecond < 0 .or. self%millisecond > 999)
then 894 character(len=5) :: zone
895 integer,
dimension(8) :: values
897 integer :: hour, minute
900 call date_and_time(zone=zone, values=values)
902 read (unit=zone(1:3), fmt=
'(I3)') hour
903 read (unit=zone(4:5), fmt=
'(I2)') minute
911 millisecond=values(8))
913 now%tz = hour + minute*m2h
917 pure elemental integer function weekday(self)
932 integer :: year, month
946 weekday = mod(self%day + ((month + 1)*26)/10 + k + k/4 + j/4 + 5*j, 7) - 1
952 pure elemental integer function isoweekday(self)
975 pure elemental character(len=9) function weekdaylong(self)
981 character(len=9),
parameter,
dimension(7) :: &
982 days = [
'Sunday ',
'Monday ',
'Tuesday ',
'Wednesday', &
983 'Thursday ',
'Friday ',
'Saturday ']
996 character(len=9),
parameter,
dimension(7) :: &
997 days = [
'Monday ',
'Tuesday ',
'Wednesday',
'Thursday ', &
998 'Friday ',
'Saturday ',
'Sunday ']
1004 pure elemental character(len=3) function weekdayshort(self)
1008 class(
datetime),
intent(in) :: self
1010 character(len=3),
parameter,
dimension(7) :: &
1011 days = [
'Sun',
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat']
1022 class(
datetime),
intent(in) :: self
1024 character(len=3),
parameter,
dimension(7) :: &
1025 days = [
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun']
1037 class(
datetime),
intent(in) :: self
1039 integer,
dimension(3) :: isocalendar
1040 integer :: year, week, wday
1042 character(len=20) :: string
1044 rc = c_strftime(string, len(string),
'%G %V %u'//c_null_char, &
1047 read (unit=string(1:4), fmt=
'(I4)') year
1048 read (unit=string(6:7), fmt=
'(I2)') week
1049 read (unit=string(9:9), fmt=
'(I1)') wday
1051 isocalendar = [year, week, wday]
1062 class(
datetime),
intent(in) :: self
1064 character(len=11) :: string
1066 string = self%strftime(
'%s')
1075 class(
datetime),
intent(in) :: self
1076 character(len=*),
intent(in) :: format
1078 character(len=:),
allocatable :: strftime
1081 character(len=MAXSTRLEN) :: resultString
1084 rc = c_strftime(resultstring, maxstrlen, trim(format)//c_null_char, &
1086 strftime = trim(resultstring)
1088 strftime = strftime(1:n - 1)
1092 pure elemental type(tm_struct) function tm(self)
1096 class(
datetime),
intent(in) :: self
1098 tm%tm_sec = self%second
1099 tm%tm_min = self%minute
1100 tm%tm_hour = self%hour
1101 tm%tm_mday = self%day
1102 tm%tm_mon = self%month - 1
1103 tm%tm_year = self%year - 1900
1104 tm%tm_wday = self%weekday()
1105 tm%tm_yday = self%yearday() - 1
1110 pure elemental character(len=5) function tzoffset(self)
1115 class(
datetime),
intent(in) :: self
1117 integer :: hours, minutes
1119 if (self%tz < 0)
then 1125 hours = int(abs(self%tz))
1126 minutes = nint((abs(self%tz) - hours)*60)
1128 if (minutes == 60)
then 1133 write (unit=
tzoffset(2:5), fmt=
'(2I2.2)') hours, minutes
1137 pure elemental type(
datetime) function utc(self)
1141 class(
datetime),
intent(in) :: self
1143 integer :: hours, minutes, sgn
1145 hours = int(abs(self%tz))
1146 minutes = nint((abs(self%tz) - hours)*60)
1147 sgn = int(sign(one, self%tz))
1149 utc = self - timedelta(hours=sgn*hours, minutes=sgn*minutes)
1154 pure elemental integer function yearday(self)
1158 class(
datetime),
intent(in) :: self
1163 do month = 1, self%month - 1
1179 class(timedelta),
intent(in) :: t
1182 integer :: milliseconds, seconds, minutes, hours, days
1185 month=d0%getMonth(), &
1187 hour=d0%getHour(), &
1188 minute=d0%getMinute(), &
1189 second=d0%getSecond(), &
1190 millisecond=d0%getMillisecond(), &
1193 milliseconds = t%getMilliseconds()
1194 seconds = t%getSeconds()
1195 minutes = t%getMinutes()
1196 hours = t%getHours()
1199 if (milliseconds /= 0)
call d%addMilliseconds(milliseconds)
1200 if (seconds /= 0)
call d%addSeconds(seconds)
1201 if (minutes /= 0)
call d%addMinutes(minutes)
1202 if (hours /= 0)
call d%addHours(hours)
1203 if (days /= 0)
call d%addDays(days)
1212 class(timedelta),
intent(in) :: t
1226 class(timedelta),
intent(in) :: t
1240 type(timedelta) :: t
1242 real(kind=real64) :: daysDiff
1243 integer :: days, hours, minutes, seconds, milliseconds
1248 if (daysdiff < 0)
then 1250 daysdiff = abs(daysdiff)
1255 days = int(daysdiff)
1256 hours = int((daysdiff - days)*d2h)
1257 minutes = int((daysdiff - days - hours*h2d)*d2m)
1258 seconds = int((daysdiff - days - hours*h2d-minutes*m2d)*d2s)
1259 milliseconds = nint((daysdiff - days - hours*h2d-minutes*m2d &
1260 -seconds*s2d)*d2s*1e3_real64)
1262 t = timedelta(sign_*days, sign_*hours, sign_*minutes, sign_*seconds, &
1267 pure elemental logical function gt(d0, d1)
1283 if (d0_utc%year > d1_utc%year)
then 1285 elseif (d0_utc%year < d1_utc%year)
then 1290 if (d0_utc%month > d1_utc%month)
then 1292 elseif (d0_utc%month < d1_utc%month)
then 1297 if (d0_utc%day > d1_utc%day)
then 1299 elseif (d0_utc%day < d1_utc%day)
then 1304 if (d0_utc%hour > d1_utc%hour)
then 1306 elseif (d0_utc%hour < d1_utc%hour)
then 1311 if (d0_utc%minute > d1_utc%minute)
then 1313 elseif (d0_utc%minute < d1_utc%minute)
then 1318 if (d0_utc%second > d1_utc%second)
then 1320 elseif (d0_utc%second < d1_utc%second)
then 1325 if (d0_utc%millisecond > d1_utc%millisecond)
then 1340 pure elemental logical function lt(d0, d1)
1352 pure elemental logical function eq(d0, d1)
1366 eq = d0_utc%year == d1_utc%year .and. &
1367 d0_utc%month == d1_utc%month .and. &
1368 d0_utc%day == d1_utc%day .and. &
1369 d0_utc%hour == d1_utc%hour .and. &
1370 d0_utc%minute == d1_utc%minute .and. &
1371 d0_utc%second == d1_utc%second .and. &
1372 d0_utc%millisecond == d1_utc%millisecond
1376 pure elemental logical function neq(d0, d1)
1384 neq = .not. d0 == d1
1388 pure elemental logical function ge(d0, d1)
1397 ge = d0 > d1 .or. d0 == d1
1401 pure elemental logical function le(d0, d1)
1410 le = d1 > d0 .or. d0 == d1
1417 pure elemental logical function isleapyear(year)
1421 integer,
intent(in) :: year
1423 isleapyear = (mod(year, 4) == 0 .and. .not. mod(year, 100) == 0) &
1424 .or. (mod(year, 400) == 0)
1437 type(timedelta),
intent(in) :: t
1439 real(kind=real64) :: datenum0, datenum1, increment
1440 real(kind=real64) :: eps
1442 type(
datetime),
dimension(:),
allocatable :: datetimeRange
1451 increment = t%total_seconds()*s2d
1453 nm = floor((datenum1 - datenum0 + eps)/increment) + 1
1455 allocate (datetimerange(nm))
1458 datetimerange(n) =
num2date(datenum0 + (n - 1)*increment)
1463 pure elemental integer function daysinmonth(month, year)
1468 integer,
intent(in) :: month
1469 integer,
intent(in) :: year
1471 integer,
parameter,
dimension(12) :: &
1472 days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
1474 if (month < 1 .or. month > 12)
then 1490 pure elemental integer function daysinyear(year)
1494 integer,
intent(in) :: year
1504 pure elemental real(kind=real64) function date2num(d)
1518 if (d_utc%year < 1)
then 1524 do year = 1, d_utc%year - 1
1532 +(d_utc%second + 1e-3_real64*d_utc%millisecond)*s2d
1536 pure elemental type(
datetime) function num2date(num)
1541 real(kind=real64),
intent(in) :: num
1544 integer :: year, month, day, hour, minute, second, millisecond
1545 real(kind=real64) :: days, totseconds
1570 totseconds = (days - day)*d2s
1571 hour = int(totseconds*s2h)
1572 minute = int((totseconds - hour*h2s)*s2m)
1573 second = int(totseconds - hour*h2s - minute*m2s)
1574 millisecond = nint((totseconds - int(totseconds))*1e3_real64)
1576 num2date =
datetime(year, month, day, hour, minute, second, millisecond, tz=zero)
1579 if (
num2date%millisecond == 1000)
then 1599 type(
datetime) function strptime(str, format)
1604 character(len=*),
intent(in) :: str
1605 character(len=*),
intent(in) :: format
1608 type(tm_struct) :: tm
1610 rc = c_strptime(trim(str)//c_null_char, trim(format)//c_null_char,
tm)
1615 pure elemental type(
datetime) function tm2date(ctime)
1620 type(tm_struct),
intent(in) :: ctime
1627 tm2date%month = ctime%tm_mon + 1
1628 tm2date%year = ctime%tm_year + 1900
1636 pure function int2str(i, length)
1641 integer,
intent(in) :: i
1642 integer,
intent(in) :: length
1644 character(len=length) :: int2str
1645 character(len=2) :: string
1647 write (unit=string, fmt=
'(I2)') length
1648 write (unit=int2str, fmt=
'(I'//string//
'.'//string//
')') i
1668 use,
intrinsic :: iso_fortran_env, only: real32, real64
1669 use,
intrinsic :: iso_c_binding, only: c_char, c_int, c_null_char
1693 logical :: alarm = .false.
1696 logical :: started = .false.
1697 logical :: stopped = .false.
1709 pure elemental subroutine reset(self)
1713 class(
clock),
intent(inout) :: self
1715 self%currentTime = self%startTime
1717 self%started = .false.
1718 self%stopped = .false.
1724 pure elemental subroutine tick(self)
1728 class(
clock),
intent(inout) :: self
1730 if (self%stopped)
then 1734 if (.not. self%started)
then 1735 self%started = .true.
1736 self%currentTime = self%startTime
1739 self%currentTime = self%currentTime + self%tickInterval
1741 if (self%currentTime >= self%stopTime)
then 1742 self%stopped = .true.
pure elemental integer function, public daysinmonth(month, year)
pure elemental type(datetime) function, public num2date(num)
pure elemental subroutine addseconds(self, s)
pure elemental integer function weekday(self)
pure elemental logical function le(d0, d1)
real(kind=real64), parameter, public h2s
pure elemental integer function getmilliseconds(self)
pure elemental subroutine tick(self)
pure character(len=length) function int2str(i, length)
pure elemental subroutine addmilliseconds(self, ms)
pure elemental type(timedelta) function timedelta_constructor(days, hours, minutes, seconds, milliseconds)
pure elemental integer function gethours(self)
pure elemental logical function lt(d0, d1)
pure elemental integer function getminutes(self)
pure elemental type(timedelta) function unary_minus_timedelta(t0)
pure elemental real(kind=real64) function gettz(self)
pure elemental real(kind=real64) function total_seconds(self)
pure elemental character(len=9) function isoweekdaylong(self)
pure elemental integer function getmonth(self)
real(kind=real64), parameter, public one
pure elemental integer function getmillisecond(self)
pure elemental subroutine adddays(self, d)
pure elemental type(datetime) function, public tm2date(ctime)
real(kind=real64), parameter, public s2h
pure elemental logical function, public isleapyear(year)
pure type(datetime) function, dimension(:), allocatable, public datetimerange(d0, d1, t)
pure elemental type(datetime) function utc(self)
pure elemental subroutine addhours(self, h)
type(datetime) function, public strptime(str, format)
pure elemental logical function isvalid(self)
pure elemental integer function getminute(self)
pure elemental character(len=5) function tzoffset(self)
type(datetime) function now()
pure elemental logical function ge(d0, d1)
pure elemental subroutine addminutes(self, m)
character(len=:) function, allocatable strftime(self, format)
pure elemental type(datetime) function datetime_constructor(year, month, day, hour, minute, second, millisecond, tz)
pure elemental logical function gt(d0, d1)
pure elemental character(len=3) function weekdayshort(self)
pure elemental logical function neq(d0, d1)
pure elemental integer function getsecond(self)
pure elemental logical function gt(td0, td1)
pure elemental type(datetime) function datetime_minus_timedelta(d0, t)
pure elemental type(datetime) function datetime_plus_timedelta(d0, t)
pure elemental logical function le(td0, td1)
pure elemental character(len=9) function weekdaylong(self)
real(kind=real64), parameter, public s2d
real(kind=real64), parameter, public d2m
pure elemental real(kind=real64) function, public date2num(d)
pure elemental integer function getdays(self)
pure elemental logical function eq(td0, td1)
real(kind=real64), parameter, public d2h
real(kind=real64), parameter, public h2d
pure elemental integer function getyear(self)
pure elemental integer function gethour(self)
real(kind=real64), parameter, public zero
real(kind=real64), parameter, public s2m
pure elemental type(datetime) function timedelta_plus_datetime(t, d0)
pure elemental integer function, public daysinyear(year)
pure elemental logical function neq(td0, td1)
pure elemental integer function getseconds(self)
pure elemental integer function getday(self)
pure elemental integer function isoweekday(self)
pure elemental type(tm_struct) function tm(self)
pure elemental type(timedelta) function timedelta_minus_timedelta(t0, t1)
pure elemental character(len=3) function isoweekdayshort(self)
real(kind=real64), parameter, public d2s
integer function secondssinceepoch(self)
real(kind=real64), parameter, public m2d
real(kind=real64), parameter, public m2h
pure elemental character(len=23) function isoformat(self, sep)
pure elemental type(timedelta) function timedelta_plus_timedelta(t0, t1)
pure elemental logical function lt(td0, td1)
pure elemental subroutine reset(self)
integer function, dimension(3) isocalendar(self)
real(kind=real64), parameter, public m2s
integer, parameter, public maxstrlen
pure elemental logical function ge(td0, td1)
pure elemental type(timedelta) function datetime_minus_datetime(d0, d1)
pure elemental logical function eq(d0, d1)
pure elemental integer function yearday(self)