
Date, time, and time interval handling for Fortran. (Specification)
Check if a year is a leap year.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | year |
Check if a datetime's year is a leap year.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt |
datetime + timedelta
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt | |||
| type(timedelta_type), | intent(in) | :: | td |
timedelta + datetime (commutative)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td | |||
| type(datetime_type), | intent(in) | :: | dt |
timedelta + timedelta
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
datetime - timedelta
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt | |||
| type(timedelta_type), | intent(in) | :: | td |
datetime - datetime (both converted to UTC)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt1 | |||
| type(datetime_type), | intent(in) | :: | dt2 |
timedelta - timedelta
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
Unary minus: -timedelta
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt1 | |||
| type(datetime_type), | intent(in) | :: | dt2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt1 | |||
| type(datetime_type), | intent(in) | :: | dt2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt1 | |||
| type(datetime_type), | intent(in) | :: | dt2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt1 | |||
| type(datetime_type), | intent(in) | :: | dt2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt1 | |||
| type(datetime_type), | intent(in) | :: | dt2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt1 | |||
| type(datetime_type), | intent(in) | :: | dt2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td1 | |||
| type(timedelta_type), | intent(in) | :: | td2 |
Represents a specific point in time.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | day | = | 1 |
Day (1-31) |
|
| integer, | public | :: | hour | = | 0 |
Hour (0-23) |
|
| integer, | public | :: | millisecond | = | 0 |
Millisecond (0-999) |
|
| integer, | public | :: | minute | = | 0 |
Minute (0-59) |
|
| integer, | public | :: | month | = | 1 |
Month (1-12) |
|
| integer, | public | :: | second | = | 0 |
Second (0-59) |
|
| integer, | public | :: | utc_offset_minutes | = | 0 |
UTC offset in minutes |
|
| integer, | public | :: | year | = | 1 |
Year (1-9999) |
Represents a duration or time interval. Normalized: seconds in [0,86399], ms in [0,999]. Days can be negative for negative durations.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | days | = | 0 |
Number of days |
|
| integer, | public | :: | milliseconds | = | 0 |
Milliseconds (0-999) |
|
| integer, | public | :: | seconds | = | 0 |
Seconds (0-86399) |
Create a datetime_type from individual components.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | optional | :: | year | ||
| integer, | intent(in), | optional | :: | month | ||
| integer, | intent(in), | optional | :: | day | ||
| integer, | intent(in), | optional | :: | hour | ||
| integer, | intent(in), | optional | :: | minute | ||
| integer, | intent(in), | optional | :: | second | ||
| integer, | intent(in), | optional | :: | millisecond | ||
| integer, | intent(in), | optional | :: | utc_offset_minutes |
Return ISO weekday (1=Monday ... 7=Sunday).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt |
Return the ordinal day of the year (1-366).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt |
Format a datetime_type as an ISO 8601 string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt |
Format a timedelta_type as a readable string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td |
Parse an ISO 8601 date/time string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | str | |||
| integer, | intent(out), | optional | :: | stat |
Create a normalized timedelta_type from mixed units.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | optional | :: | days | ||
| integer, | intent(in), | optional | :: | hours | ||
| integer, | intent(in), | optional | :: | minutes | ||
| integer, | intent(in), | optional | :: | seconds | ||
| integer, | intent(in), | optional | :: | milliseconds |
Convert a datetime to UTC.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(datetime_type), | intent(in) | :: | dt |
Return the total duration in seconds as real(dp).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(timedelta_type), | intent(in) | :: | td |