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

This is a container to hold a date-time. More...

Public Member Functions

procedure, public replace (this, year, month, day, hour, minute, second)
 new datetime with specified fields
 
procedure, public date (this)
 date of the datetime
 
procedure, public time (this)
 time of the datetime
 
procedure, public str (this)
 string representation of the datetime
 
procedure, public julian (this, calendar)
 datetime 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
 
procedure, public is_new_day (this)
 datetime is a new day
 
procedure, public is_new_hour (this)
 datetime is a new hour
 
procedure, public is_new_minute (this)
 datetime is a new month
 
generic, public assignment (this, that)
 copy a datetime
 
generic, public assignment (this, that)
 copy a datetime from a date
 
generic, public operator (this, that)
 equal comparison of datetimes
 
generic, public operator (this, that)
 equal comparison of datetime and date
 
generic, public operator (this, that)
 not equal comparison of datetimes
 
generic, public operator (this, that)
 not equal comparison of datetime and date
 
generic, public operator (this, that)
 less than comparison of datetimes
 
generic, public operator (this, that)
 less than comparison of datetime and date
 
generic, public operator (this, that)
 greater than comparison of datetimes
 
generic, public operator (this, that)
 greater than comparison of datetime and date
 
generic, public operator (this, that)
 less than or equal comparison of datetimes
 
generic, public operator (this, that)
 less than or equal comparison of datetime and date
 
generic, public operator (this, that)
 greater than or equal comparison of datetimes
 
generic, public operator (this, that)
 less than or equal comparison of datetime and date
 
generic, public operator (this, that)
 add a timedelta to a datetime
 
generic, public operator (that, this)
 add a timedelta to a datetime
 
generic, public operator (this, that)
 subtract a timedelta from a datetime
 
generic, public operator (this, that)
 difference between two datetimes
 
generic, public operator (this, that)
 difference between datetime and date
 

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
 
integer(i4), public hour = 0_i4
 0 <= hour < 24
 
integer(i4), public minute = 0_i4
 0 <= minute < 60
 
integer(i4), public second = 0_i4
 0 <= second < 60
 

Private Member Functions

procedure, private dt_copy_dt (this, that)
 copy a datetime
 
private dt_copy_d (this, that)
 copy a datetime from a date
 
procedure, private dt_eq (this, that)
 equal comparison of datetimes
 
private dt_eq_d (this, that)
 equal comparison of datetime and date
 
procedure, private dt_neq (this, that)
 not equal comparison of datetimes
 
private dt_neq_d (this, that)
 not equal comparison of datetime and date
 
procedure, private dt_lt (this, that)
 less than comparison of datetimes
 
private dt_lt_d (this, that)
 less than comparison of datetime and date
 
procedure, private dt_gt (this, that)
 greater than comparison of datetimes
 
private dt_gt_d (this, that)
 greater than comparison of datetime and date
 
procedure, private dt_leq (this, that)
 less than or equal comparison of datetimes
 
private dt_leq_d (this, that)
 less than or equal comparison of datetime and date
 
procedure, private dt_geq (this, that)
 greater than or equal comparison of datetimes
 
private dt_geq_d (this, that)
 less than or equal comparison of datetime and date
 
procedure, private dt_add_td (this, that)
 add a timedelta to a datetime
 
procedure, pass, private td_add_dt (that, this)
 add a timedelta to a datetime
 
procedure, private dt_sub_td (this, that)
 subtract a timedelta from a datetime
 
private dt_sub_dt (this, that)
 difference between two datetimes
 
private dt_sub_d (this, that)
 difference between datetime and date
 

Detailed Description

This is a container to hold a date-time.

Definition at line 246 of file mo_datetime.f90.

Member Function/Subroutine Documentation

◆ assignment() [1/2]

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

copy a datetime from a date

Definition at line 281 of file mo_datetime.f90.

◆ assignment() [2/2]

generic, public mo_datetime::datetime::assignment ( class(datetime), intent(inout)  this,
class(datetime), intent(in)  that 
)

copy a datetime

Definition at line 281 of file mo_datetime.f90.

References mo_datetime::dt_copy_d(), and mo_datetime::dt_copy_dt().

Here is the call graph for this function:

◆ date()

procedure, public mo_datetime::datetime::date ( class(datetime), intent(in)  this)

date of the datetime

See also
mo_datetime::get_date

Definition at line 257 of file mo_datetime.f90.

◆ doy()

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

day of the year

See also
mo_datetime::dt_doy

Definition at line 267 of file mo_datetime.f90.

◆ dt_add_td()

procedure, private mo_datetime::datetime::dt_add_td ( class(datetime), intent(in)  this,
class(timedelta), intent(in)  that 
)
private

add a timedelta to a datetime

Definition at line 294 of file mo_datetime.f90.

◆ dt_copy_d()

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

copy a datetime from a date

Definition at line 280 of file mo_datetime.f90.

◆ dt_copy_dt()

procedure, private mo_datetime::datetime::dt_copy_dt ( class(datetime), intent(inout)  this,
class(datetime), intent(in)  that 
)
private

copy a datetime

Definition at line 280 of file mo_datetime.f90.

◆ dt_eq()

procedure, private mo_datetime::datetime::dt_eq ( class(datetime), intent(in)  this,
class(datetime), intent(in)  that 
)
private

equal comparison of datetimes

Definition at line 282 of file mo_datetime.f90.

◆ dt_eq_d()

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

equal comparison of datetime and date

Definition at line 282 of file mo_datetime.f90.

◆ dt_geq()

procedure, private mo_datetime::datetime::dt_geq ( class(datetime), intent(in)  this,
class(datetime), intent(in)  that 
)
private

greater than or equal comparison of datetimes

Definition at line 292 of file mo_datetime.f90.

◆ dt_geq_d()

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

less than or equal comparison of datetime and date

Definition at line 292 of file mo_datetime.f90.

◆ dt_gt()

procedure, private mo_datetime::datetime::dt_gt ( class(datetime), intent(in)  this,
class(datetime), intent(in)  that 
)
private

greater than comparison of datetimes

Definition at line 288 of file mo_datetime.f90.

◆ dt_gt_d()

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

greater than comparison of datetime and date

Definition at line 288 of file mo_datetime.f90.

◆ dt_leq()

procedure, private mo_datetime::datetime::dt_leq ( class(datetime), intent(in)  this,
class(datetime), intent(in)  that 
)
private

less than or equal comparison of datetimes

Definition at line 290 of file mo_datetime.f90.

◆ dt_leq_d()

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

less than or equal comparison of datetime and date

Definition at line 290 of file mo_datetime.f90.

◆ dt_lt()

procedure, private mo_datetime::datetime::dt_lt ( class(datetime), intent(in)  this,
class(datetime), intent(in)  that 
)
private

less than comparison of datetimes

Definition at line 286 of file mo_datetime.f90.

◆ dt_lt_d()

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

less than comparison of datetime and date

Definition at line 286 of file mo_datetime.f90.

◆ dt_neq()

procedure, private mo_datetime::datetime::dt_neq ( class(datetime), intent(in)  this,
class(datetime), intent(in)  that 
)
private

not equal comparison of datetimes

Definition at line 284 of file mo_datetime.f90.

◆ dt_neq_d()

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

not equal comparison of datetime and date

Definition at line 284 of file mo_datetime.f90.

◆ dt_sub_d()

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

difference between datetime and date

Definition at line 297 of file mo_datetime.f90.

◆ dt_sub_dt()

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

difference between two datetimes

Definition at line 297 of file mo_datetime.f90.

◆ dt_sub_td()

procedure, private mo_datetime::datetime::dt_sub_td ( class(datetime), intent(in)  this,
class(timedelta), intent(in)  that 
)
private

subtract a timedelta from a datetime

Definition at line 297 of file mo_datetime.f90.

◆ is_new_day()

procedure, public mo_datetime::datetime::is_new_day ( class(datetime), intent(in)  this)

datetime is a new day

See also
mo_datetime::is_new_day

Definition at line 275 of file mo_datetime.f90.

◆ is_new_hour()

procedure, public mo_datetime::datetime::is_new_hour ( class(datetime), intent(in)  this)

datetime is a new hour

See also
mo_datetime::is_new_hour

Definition at line 277 of file mo_datetime.f90.

◆ is_new_minute()

procedure, public mo_datetime::datetime::is_new_minute ( class(datetime), intent(in)  this)

datetime is a new month

See also
mo_datetime::is_new_minute

Definition at line 279 of file mo_datetime.f90.

◆ is_new_month()

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

datetime is a new month

See also
mo_datetime::is_new_month

Definition at line 271 of file mo_datetime.f90.

◆ is_new_week()

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

datetime is a new week

See also
mo_datetime::is_new_week

Definition at line 273 of file mo_datetime.f90.

◆ is_new_year()

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

datetime is a new year

See also
mo_datetime::is_new_year

Definition at line 269 of file mo_datetime.f90.

◆ julian()

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

datetime as fractional julian day

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

Definition at line 263 of file mo_datetime.f90.

◆ operator() [1/17]

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

add a timedelta to a datetime

Definition at line 296 of file mo_datetime.f90.

◆ operator() [2/17]

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

equal comparison of datetimes

Definition at line 283 of file mo_datetime.f90.

References mo_datetime::dt_eq(), and mo_datetime::dt_eq_d().

Here is the call graph for this function:

◆ operator() [3/17]

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

equal comparison of datetime and date

Definition at line 283 of file mo_datetime.f90.

◆ operator() [4/17]

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

not equal comparison of datetime and date

Definition at line 285 of file mo_datetime.f90.

◆ operator() [5/17]

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

not equal comparison of datetimes

Definition at line 285 of file mo_datetime.f90.

References mo_datetime::dt_neq(), and mo_datetime::dt_neq_d().

Here is the call graph for this function:

◆ operator() [6/17]

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

less than comparison of datetimes

Definition at line 287 of file mo_datetime.f90.

References mo_datetime::dt_lt(), and mo_datetime::dt_lt_d().

Here is the call graph for this function:

◆ operator() [7/17]

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

less than comparison of datetime and date

Definition at line 287 of file mo_datetime.f90.

◆ operator() [8/17]

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

greater than comparison of datetimes

Definition at line 289 of file mo_datetime.f90.

References mo_datetime::dt_gt(), and mo_datetime::dt_gt_d().

Here is the call graph for this function:

◆ operator() [9/17]

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

greater than comparison of datetime and date

Definition at line 289 of file mo_datetime.f90.

◆ operator() [10/17]

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

less than or equal comparison of datetimes

Definition at line 291 of file mo_datetime.f90.

References mo_datetime::dt_leq(), and mo_datetime::dt_leq_d().

Here is the call graph for this function:

◆ operator() [11/17]

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

less than or equal comparison of datetime and date

Definition at line 291 of file mo_datetime.f90.

◆ operator() [12/17]

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

greater than or equal comparison of datetimes

Definition at line 293 of file mo_datetime.f90.

References mo_datetime::dt_geq(), and mo_datetime::dt_geq_d().

Here is the call graph for this function:

◆ operator() [13/17]

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

less than or equal comparison of datetime and date

Definition at line 293 of file mo_datetime.f90.

◆ operator() [14/17]

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

add a timedelta to a datetime

Definition at line 296 of file mo_datetime.f90.

References mo_datetime::dt_add_td(), and mo_datetime::td_add_dt().

Here is the call graph for this function:

◆ operator() [15/17]

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

subtract a timedelta from a datetime

Definition at line 298 of file mo_datetime.f90.

References mo_datetime::dt_sub_d(), mo_datetime::dt_sub_dt(), and mo_datetime::dt_sub_td().

Here is the call graph for this function:

◆ operator() [16/17]

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

difference between two datetimes

Definition at line 298 of file mo_datetime.f90.

◆ operator() [17/17]

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

difference between datetime and date

Definition at line 298 of file mo_datetime.f90.

◆ replace()

procedure, public mo_datetime::datetime::replace ( class(datetime), intent(in)  this,
integer(i4), intent(in), optional  year,
integer(i4), intent(in), optional  month,
integer(i4), intent(in), optional  day,
integer(i4), intent(in), optional  hour,
integer(i4), intent(in), optional  minute,
integer(i4), intent(in), optional  second 
)

new datetime with specified fields

Parameters
[in]year1 <= year <= 9999
[in]month1 <= month <= 12
[in]day1 <= day <= number of days in the given month and year
[in]hour0 <= hour < 24
[in]minute0 <= minute < 60
[in]second0 <= second < 60
See also
mo_datetime::dt_replace

Definition at line 255 of file mo_datetime.f90.

◆ str()

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

string representation of the datetime

See also
mo_datetime::dt_str

Definition at line 261 of file mo_datetime.f90.

◆ td_add_dt()

procedure, pass, private mo_datetime::datetime::td_add_dt ( class(timedelta), intent(in)  that,
class(datetime), intent(in)  this 
)
private

add a timedelta to a datetime

Definition at line 295 of file mo_datetime.f90.

◆ time()

procedure, public mo_datetime::datetime::time ( class(datetime), intent(in)  this)

time of the datetime

See also
mo_datetime::get_time

Definition at line 259 of file mo_datetime.f90.

◆ weekday()

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

day of the week

See also
mo_datetime::dt_weekday

Definition at line 265 of file mo_datetime.f90.

Member Data Documentation

◆ day

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

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

Definition at line 249 of file mo_datetime.f90.

◆ hour

integer(i4), public mo_datetime::datetime::hour = 0_i4

0 <= hour < 24

Definition at line 250 of file mo_datetime.f90.

◆ minute

integer(i4), public mo_datetime::datetime::minute = 0_i4

0 <= minute < 60

Definition at line 251 of file mo_datetime.f90.

◆ month

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

1 <= month <= 12

Definition at line 248 of file mo_datetime.f90.

◆ second

integer(i4), public mo_datetime::datetime::second = 0_i4

0 <= second < 60

Definition at line 252 of file mo_datetime.f90.

◆ year

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

1 <= year <= 9999

Definition at line 247 of file mo_datetime.f90.


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