datetime Derived Type

type, public :: datetime


Components

Type Visibility Attributes Name Initial
integer, private :: year = 1
integer, private :: month = 1
integer, private :: day = 1
integer, private :: hour = 0
integer, private :: minute = 0
integer, private :: second = 0
integer, private :: millisecond = 0
real(kind=real64), private :: tz = 0

Constructor

public interface datetime

  • public pure elemental function datetime_constructor(year, month, day, hour, minute, second, millisecond, tz)

    Arguments

    Type IntentOptional 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
    real(kind=real64), intent(in), optional :: tz

    Return Value type(datetime)


Type-Bound Procedures

procedure, public, pass(self) :: getYear

  • public pure elemental function getYear(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: getMonth

  • public pure elemental function getMonth(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: getDay

  • public pure elemental function getDay(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: getHour

  • public pure elemental function getHour(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: getMinute

  • public pure elemental function getMinute(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: getSecond

  • public pure elemental function getSecond(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: getMillisecond

  • public pure elemental function getMillisecond(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: getTz

  • public pure elemental function getTz(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value real(kind=real64)

procedure, public, pass(self) :: isocalendar

  • public function isocalendar(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer, (3)

procedure, public, pass(self) :: isoformat

  • public pure elemental function isoformat(self, sep)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self
    character(len=1), intent(in), optional :: sep

    Return Value character(len=23)

procedure, public, pass(self) :: isValid

  • public pure elemental function isValid(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value logical

procedure, public, nopass :: now

  • public function now()

    Arguments

    None

    Return Value type(datetime)

procedure, public, pass(self) :: secondsSinceEpoch

  • public function secondsSinceEpoch(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer(kind=int64)

procedure, public, pass(self) :: strftime

  • public function strftime(self, format)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self
    character(len=*), intent(in) :: format

    Return Value character(len=:), allocatable

procedure, public, pass(self) :: tm

  • public pure elemental function tm(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value type(tm_struct)

procedure, public, pass(self) :: tzOffset

  • public pure elemental function tzOffset(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value character(len=5)

procedure, public, pass(self) :: isoweekday

  • public pure elemental function isoweekday(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: isoweekdayLong

  • public pure elemental function isoweekdayLong(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value character(len=9)

procedure, public, pass(self) :: isoweekdayShort

  • public pure elemental function isoweekdayShort(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value character(len=3)

procedure, public, pass(self) :: utc

  • public pure elemental function utc(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value type(datetime)

procedure, public, pass(self) :: weekday

  • public pure elemental function weekday(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: weekdayLong

  • public pure elemental function weekdayLong(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value character(len=9)

procedure, public, pass(self) :: weekdayShort

  • public pure elemental function weekdayShort(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value character(len=3)

procedure, public, pass(self) :: yearday

  • public pure elemental function yearday(self)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: self

    Return Value integer

procedure, private, pass(self) :: addMilliseconds

  • public pure elemental subroutine addMilliseconds(self, ms)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(inout) :: self
    integer, intent(in) :: ms

procedure, private, pass(self) :: addSeconds

  • public pure elemental subroutine addSeconds(self, s)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(inout) :: self
    integer, intent(in) :: s

procedure, private, pass(self) :: addMinutes

  • public pure elemental subroutine addMinutes(self, m)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(inout) :: self
    integer, intent(in) :: m

procedure, private, pass(self) :: addHours

  • public pure elemental subroutine addHours(self, h)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(inout) :: self
    integer, intent(in) :: h

procedure, private, pass(self) :: addDays

  • public pure elemental subroutine addDays(self, d)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(inout) :: self
    integer, intent(in) :: d

procedure, private, pass(d0) :: datetime_plus_timedelta

procedure, private, pass(d0) :: timedelta_plus_datetime

procedure, private, pass(d0) :: datetime_minus_datetime

procedure, private, pass(d0) :: datetime_minus_timedelta

procedure, private, pass(d0) :: datetime_eq

  • public pure elemental function datetime_eq(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

procedure, private, pass(d0) :: datetime_neq

  • public pure elemental function datetime_neq(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

procedure, private, pass(d0) :: datetime_gt

  • public pure elemental function datetime_gt(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

procedure, private, pass(d0) :: datetime_ge

  • public pure elemental function datetime_ge(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

procedure, private, pass(d0) :: datetime_lt

  • public pure elemental function datetime_lt(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

procedure, private, pass(d0) :: datetime_le

  • public pure elemental function datetime_le(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

generic, public :: operator(+) => datetime_plus_timedelta, timedelta_plus_datetime

generic, public :: operator(-) => datetime_minus_datetime, datetime_minus_timedelta

generic, public :: operator(==) => datetime_eq

  • public pure elemental function datetime_eq(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

generic, public :: operator(/=) => datetime_neq

  • public pure elemental function datetime_neq(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

generic, public :: operator(>) => datetime_gt

  • public pure elemental function datetime_gt(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

generic, public :: operator(>=) => datetime_ge

  • public pure elemental function datetime_ge(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

generic, public :: operator(<) => datetime_lt

  • public pure elemental function datetime_lt(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical

generic, public :: operator(<=) => datetime_le

  • public pure elemental function datetime_le(d0, d1) result(res)

    Arguments

    Type IntentOptional Attributes Name
    class(datetime), intent(in) :: d0
    class(datetime), intent(in) :: d1

    Return Value logical