TOML datetime value representation
This module provides the toml_datetime type for representing TOML
datetime values. TOML supports four datetime formats:
- Offset date-time:
1979-05-27T07:32:00Z
- Local date-time:
1979-05-27T07:32:00
- Local date:
1979-05-27
- Local time:
07:32:00
The toml_datetime type combines toml_date and toml_time
components to represent any of these formats.
Interfaces
-
private pure function compare_datetime(lhs, rhs) result(match)
Arguments
Return Value
logical
-
private pure function to_string_datetime(datetime) result(str)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(toml_datetime),
|
intent(in) |
|
|
:: |
datetime |
|
Return Value
character(kind=tfc, len=:), allocatable
Create a new TOML datetime value
-
private pure function new_datetime(year, month, day, hour, minute, second, msecond, zone) result(datetime)
Arguments
| 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 |
|
:: |
msecond |
|
|
character(len=*),
|
intent(in), |
optional |
|
:: |
zone |
|
-
private pure function new_datetime_from_string(string) result(datetime)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
string |
|
Derived Types
TOML date value (YYYY-MM-DD)
Components
| Type |
Visibility | Attributes |
|
Name |
| Initial | |
|
integer,
|
public |
|
:: |
day |
= |
-1 |
|
|
integer,
|
public |
|
:: |
month |
= |
-1 |
|
|
integer,
|
public |
|
:: |
year |
= |
-1 |
|
TOML datatime value type
Components
| Type |
Visibility | Attributes |
|
Name |
| Initial | |
|
type(toml_date),
|
public |
|
:: |
date |
|
|
|
|
type(toml_time),
|
public |
|
:: |
time |
|
|
|
Constructor
Create a new TOML datetime value
|
private
pure
function
new_datetime
(year, month, day, hour, minute, second, msecond, zone)
|
|
|
private
pure
function
new_datetime_from_string
(string)
|
|
TOML time value (HH:MM:SS.sssssZ…)
Components
| Type |
Visibility | Attributes |
|
Name |
| Initial | |
|
integer,
|
public |
|
:: |
hour |
= |
-1 |
|
|
integer,
|
public |
|
:: |
minute |
= |
-1 |
|
|
integer,
|
public |
|
:: |
msec |
= |
-1 |
|
|
integer,
|
public |
|
:: |
second |
= |
-1 |
|
|
character(len=:),
|
public, |
allocatable
|
:: |
zone |
|
|
|
Constructor
|
private
elemental
function
new_toml_time
(hour, minute, second, msec, zone)
|
Constructor for toml_time type, necessary due to PGI bug in NVHPC 20.7 and 20.9 |
Functions
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
class(toml_datetime),
|
intent(in) |
|
|
:: |
datetime |
|
Return Value
logical
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
class(toml_datetime),
|
intent(in) |
|
|
:: |
datetime |
|
Return Value
logical