0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_datetime::puredate Module Reference

This is a container to hold only a date. More...

Public Member Functions

procedure, public replace (this, year, month, day)
 new date with specified fields
 
procedure, public with_time (in_date, in_time)
 datetime from date and time
 
procedure, public to_datetime (this)
 convert date to a datetime
 
procedure, public to_ordinal (this)
 convert date to number of days since year 1
 
procedure, public str (this)
 string representation of the date
 
procedure, public julian (this, calendar)
 date as fractional julian day
 
procedure, public weekday (this)
 day of the week
 
procedure, public doy (this)
 day of the year
 
procedure, public is_new_year (this)
 datetime is a new year
 
procedure, public is_new_month (this)
 datetime is a new month
 
procedure, public is_new_week (this)
 datetime is a new week
 
generic, public operator (this, that)
 equal comparison of dates
 
generic, public operator (this, that)
 equal comparison of date and datetime
 
generic, public operator (this, that)
 not equal comparison of dates
 
generic, public operator (this, that)
 not equal comparison of date and datetime
 
generic, public operator (this, that)
 less than comparison of dates
 
generic, public operator (this, that)
 less than comparison of date and datetime
 
generic, public operator (this, that)
 greater than comparison of dates
 
generic, public operator (this, that)
 greater than comparison of date and datetime
 
generic, public operator (this, that)
 less than or equal comparison of dates
 
generic, public operator (this, that)
 less than or equal comparison of date and datetime
 
generic, public operator (this, that)
 greater than or equal comparison of dates
 
generic, public operator (this, that)
 greater than or equal comparison of date and datetime
 
generic, public operator (this, that)
 add a timedelta to a date
 
generic, public operator (that, this)
 add a timedelta to a date
 
generic, public operator (this, that)
 subtract a timedelta from a date
 
generic, public operator (this, that)
 difference between two dates
 
generic, public operator (this, that)
 difference between date and datetime
 

Public Attributes

integer(i4), public year = 1_i4
 1 <= year <= 9999
 
integer(i4), public month = 1_i4
 1 <= month <= 12
 
integer(i4), public day = 1_i4
 1 <= day <= number of days in the given month and year
 

Private Member Functions

procedure, private d_eq (this, that)
 equal comparison of dates
 
private d_eq_dt (this, that)
 equal comparison of date and datetime
 
procedure, private d_neq (this, that)
 not equal comparison of dates
 
private d_neq_dt (this, that)
 not equal comparison of date and datetime
 
procedure, private d_lt (this, that)
 less than comparison of dates
 
private d_lt_dt (this, that)
 less than comparison of date and datetime
 
procedure, private d_gt (this, that)
 greater than comparison of dates
 
private d_gt_dt (this, that)
 greater than comparison of date and datetime
 
procedure, private d_leq (this, that)
 less than or equal comparison of dates
 
private d_leq_dt (this, that)
 less than or equal comparison of date and datetime
 
procedure, private d_geq (this, that)
 greater than or equal comparison of dates
 
private d_geq_dt (this, that)
 greater than or equal comparison of date and datetime
 
procedure, private d_add_td (this, that)
 add a timedelta to a date
 
procedure, pass, private td_add_d (that, this)
 add a timedelta to a date
 
procedure, private d_sub_td (this, that)
 subtract a timedelta from a date
 
private d_sub_d (this, that)
 difference between two dates
 
private d_sub_dt (this, that)
 difference between date and datetime
 

Detailed Description

This is a container to hold only a date.

Definition at line 154 of file mo_datetime.f90.

Member Function/Subroutine Documentation

◆ d_add_td()

procedure, private mo_datetime::puredate::d_add_td ( class(puredate), intent(in)  this,
class(timedelta), intent(in)  that 
)
private

add a timedelta to a date

Definition at line 193 of file mo_datetime.f90.

◆ d_eq()

procedure, private mo_datetime::puredate::d_eq ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)
private

equal comparison of dates

Definition at line 181 of file mo_datetime.f90.

◆ d_eq_dt()

private mo_datetime::puredate::d_eq_dt ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)
private

equal comparison of date and datetime

Definition at line 181 of file mo_datetime.f90.

◆ d_geq()

procedure, private mo_datetime::puredate::d_geq ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)
private

greater than or equal comparison of dates

Definition at line 191 of file mo_datetime.f90.

◆ d_geq_dt()

private mo_datetime::puredate::d_geq_dt ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)
private

greater than or equal comparison of date and datetime

Definition at line 191 of file mo_datetime.f90.

◆ d_gt()

procedure, private mo_datetime::puredate::d_gt ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)
private

greater than comparison of dates

Definition at line 187 of file mo_datetime.f90.

◆ d_gt_dt()

private mo_datetime::puredate::d_gt_dt ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)
private

greater than comparison of date and datetime

Definition at line 187 of file mo_datetime.f90.

◆ d_leq()

procedure, private mo_datetime::puredate::d_leq ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)
private

less than or equal comparison of dates

Definition at line 189 of file mo_datetime.f90.

◆ d_leq_dt()

private mo_datetime::puredate::d_leq_dt ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)
private

less than or equal comparison of date and datetime

Definition at line 189 of file mo_datetime.f90.

◆ d_lt()

procedure, private mo_datetime::puredate::d_lt ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)
private

less than comparison of dates

Definition at line 185 of file mo_datetime.f90.

◆ d_lt_dt()

private mo_datetime::puredate::d_lt_dt ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)
private

less than comparison of date and datetime

Definition at line 185 of file mo_datetime.f90.

◆ d_neq()

procedure, private mo_datetime::puredate::d_neq ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)
private

not equal comparison of dates

Definition at line 183 of file mo_datetime.f90.

◆ d_neq_dt()

private mo_datetime::puredate::d_neq_dt ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)
private

not equal comparison of date and datetime

Definition at line 183 of file mo_datetime.f90.

◆ d_sub_d()

private mo_datetime::puredate::d_sub_d ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)
private

difference between two dates

Definition at line 196 of file mo_datetime.f90.

◆ d_sub_dt()

private mo_datetime::puredate::d_sub_dt ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)
private

difference between date and datetime

Definition at line 196 of file mo_datetime.f90.

◆ d_sub_td()

procedure, private mo_datetime::puredate::d_sub_td ( class(puredate), intent(in)  this,
class(timedelta), intent(in)  that 
)
private

subtract a timedelta from a date

Definition at line 196 of file mo_datetime.f90.

◆ doy()

procedure, public mo_datetime::puredate::doy ( class(puredate), intent(in)  this)

day of the year

See also
mo_datetime::d_doy

Definition at line 174 of file mo_datetime.f90.

◆ is_new_month()

procedure, public mo_datetime::puredate::is_new_month ( class(puredate), intent(in)  this)

datetime is a new month

See also
mo_datetime::is_new_month

Definition at line 178 of file mo_datetime.f90.

◆ is_new_week()

procedure, public mo_datetime::puredate::is_new_week ( class(puredate), intent(in)  this)

datetime is a new week

See also
mo_datetime::is_new_week

Definition at line 180 of file mo_datetime.f90.

◆ is_new_year()

procedure, public mo_datetime::puredate::is_new_year ( class(puredate), intent(in)  this)

datetime is a new year

See also
mo_datetime::is_new_year

Definition at line 176 of file mo_datetime.f90.

◆ julian()

procedure, public mo_datetime::puredate::julian ( class(puredate), intent(in)  this,
integer(i4), intent(in), optional  calendar 
)

date as fractional julian day

Parameters
[in]calendarThe calendar to use, the global calendar will be used by default
See also
mo_datetime::d_julian

Definition at line 170 of file mo_datetime.f90.

◆ operator() [1/17]

generic, public mo_datetime::puredate::operator ( class(timedelta), intent(in)  that,
class(puredate), intent(in)  this 
)

add a timedelta to a date

Definition at line 195 of file mo_datetime.f90.

◆ operator() [2/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)

equal comparison of date and datetime

Definition at line 182 of file mo_datetime.f90.

◆ operator() [3/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)

equal comparison of dates

Definition at line 182 of file mo_datetime.f90.

References mo_datetime::d_eq(), and mo_datetime::d_eq_dt().

Here is the call graph for this function:

◆ operator() [4/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)

not equal comparison of dates

Definition at line 184 of file mo_datetime.f90.

References mo_datetime::d_neq(), and mo_datetime::d_neq_dt().

Here is the call graph for this function:

◆ operator() [5/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)

not equal comparison of date and datetime

Definition at line 184 of file mo_datetime.f90.

◆ operator() [6/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)

less than comparison of date and datetime

Definition at line 186 of file mo_datetime.f90.

◆ operator() [7/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)

less than comparison of dates

Definition at line 186 of file mo_datetime.f90.

References mo_datetime::d_lt(), and mo_datetime::d_lt_dt().

Here is the call graph for this function:

◆ operator() [8/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)

greater than comparison of dates

Definition at line 188 of file mo_datetime.f90.

References mo_datetime::d_gt(), and mo_datetime::d_gt_dt().

Here is the call graph for this function:

◆ operator() [9/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)

greater than comparison of date and datetime

Definition at line 188 of file mo_datetime.f90.

◆ operator() [10/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)

less than or equal comparison of dates

Definition at line 190 of file mo_datetime.f90.

References mo_datetime::d_leq(), and mo_datetime::d_leq_dt().

Here is the call graph for this function:

◆ operator() [11/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)

less than or equal comparison of date and datetime

Definition at line 190 of file mo_datetime.f90.

◆ operator() [12/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)

greater than or equal comparison of dates

Definition at line 192 of file mo_datetime.f90.

References mo_datetime::d_geq(), and mo_datetime::d_geq_dt().

Here is the call graph for this function:

◆ operator() [13/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)

greater than or equal comparison of date and datetime

Definition at line 192 of file mo_datetime.f90.

◆ operator() [14/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(timedelta), intent(in)  that 
)

add a timedelta to a date

Definition at line 195 of file mo_datetime.f90.

References mo_datetime::d_add_td(), and mo_datetime::td_add_d().

Here is the call graph for this function:

◆ operator() [15/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(timedelta), intent(in)  that 
)

subtract a timedelta from a date

Definition at line 197 of file mo_datetime.f90.

References mo_datetime::d_sub_d(), mo_datetime::d_sub_dt(), and mo_datetime::d_sub_td().

Here is the call graph for this function:

◆ operator() [16/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(puredate), intent(in)  that 
)

difference between two dates

Definition at line 197 of file mo_datetime.f90.

◆ operator() [17/17]

generic, public mo_datetime::puredate::operator ( class(puredate), intent(in)  this,
class(datetime), intent(in)  that 
)

difference between date and datetime

Definition at line 197 of file mo_datetime.f90.

◆ replace()

procedure, public mo_datetime::puredate::replace ( class(puredate), intent(in)  this,
integer(i4), intent(in), optional  year,
integer(i4), intent(in), optional  month,
integer(i4), intent(in), optional  day 
)

new date with specified fields

Parameters
[in]year1 <= year <= 9999
[in]month1 <= month <= 12
[in]day1 <= day <= number of days in the given month and year
See also
mo_datetime::d_replace

Definition at line 160 of file mo_datetime.f90.

◆ str()

procedure, public mo_datetime::puredate::str ( class(puredate), intent(in)  this)

string representation of the date

See also
mo_datetime::d_str

Definition at line 168 of file mo_datetime.f90.

◆ td_add_d()

procedure, pass, private mo_datetime::puredate::td_add_d ( class(timedelta), intent(in)  that,
class(puredate), intent(in)  this 
)
private

add a timedelta to a date

Definition at line 194 of file mo_datetime.f90.

◆ to_datetime()

procedure, public mo_datetime::puredate::to_datetime ( class(puredate), intent(in)  this)

convert date to a datetime

See also
mo_datetime::to_datetime

Definition at line 164 of file mo_datetime.f90.

◆ to_ordinal()

procedure, public mo_datetime::puredate::to_ordinal ( class(puredate), intent(in)  this)

convert date to number of days since year 1

See also
mo_datetime::to_ordinal

Definition at line 166 of file mo_datetime.f90.

◆ weekday()

procedure, public mo_datetime::puredate::weekday ( class(puredate), intent(in)  this)

day of the week

See also
mo_datetime::d_weekday

Definition at line 172 of file mo_datetime.f90.

◆ with_time()

procedure, public mo_datetime::puredate::with_time ( class(puredate), intent(in)  in_date,
class(puretime), intent(in), optional  in_time 
)

datetime from date and time

Parameters
[in]in_datedate to use
[in]in_timetime to use (midnight by default)
See also
mo_datetime::dt_from_date_time

Definition at line 162 of file mo_datetime.f90.

Member Data Documentation

◆ day

integer(i4), public mo_datetime::puredate::day = 1_i4

1 <= day <= number of days in the given month and year

Definition at line 157 of file mo_datetime.f90.

◆ month

integer(i4), public mo_datetime::puredate::month = 1_i4

1 <= month <= 12

Definition at line 156 of file mo_datetime.f90.

◆ year

integer(i4), public mo_datetime::puredate::year = 1_i4

1 <= year <= 9999

Definition at line 155 of file mo_datetime.f90.


The documentation for this module was generated from the following file: