Compact representation of date and time Stores all components in minimal integer kinds to reduce memory usage. All fields are public for easy access.
Constructor interface for datetime type.
This type intentionally provides only the functionality required by fpx. It is designed to be compact, portable, and efficient rather than serving as a comprehensive date/time framework.
Initializes a new instance of the datetime class. Two constructor forms are available:
Constructor
| [in] | string | date as string |
| [in] | fmt | (optional) date format |
Examples
Constructor
| [in] | year | (optional) |
| [in] | month | (optional) |
| [in] | day | (optional) |
| [in] | hour | (optional) |
| [in] | minute | (optional) |
| [in] | second | (optional) |
| [in] | millisecond | (optional) |
Examples
Variables | |
| integer(i2), public | year |
| Year. | |
| integer(i1), public | month |
| Month. | |
| integer(i1), public | day |
| Day. | |
| integer(i1), public | hour |
| Hour. | |
| integer(i1), public | minute |
| Minute. | |
| integer(i1), public | second |
| Second. | |
| integer(i2), public | millisecond |
| Millisecond. | |
| procedure, pass, public parse | ( | class(datetime), intent(inout) | this, |
| character(*), intent(in) | string, | ||
| character(*), intent(in), optional | fmt ) |
Parse date/time from string using common formats.
Supports ISO, US, and abbreviated month formats. On error, defaults to Unix epoch (1970-01-01 00:00:00) Perform conversion to ISO string
| procedure, pass, public to_string | ( | class(datetime), intent(in) | this, |
| character(*), intent(in), optional | fmt ) |