ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
This module contains classes and procedures for computing, manipulating, and styling dates and times. More...
Data Types | |
interface | dateTimeInt_type |
This is the derived type containing the components of a numeric date and time in the Gregorian calendar. More... | |
interface | dateTimeStr_type |
This is the derived type containing the string components that contain numeric date and time in the Gregorian calendar. More... | |
interface | getCountDays |
Generate and return the total number of days in the specified year or the month of the year of the Gregorian calendar. More... | |
interface | getCountLeapYears |
Generate and return the number of leap years within the closed year interval [since, until] where since represents the origin year, and until represents a later year after since . More... | |
interface | getCountWeeks |
Generate and return the number of weeks in the specified year or the month of the year of the Gregorian calendar whose majority of days fall within the specified year or month. More... | |
interface | getDateAfter |
Generate and return the date in the Gregorian Calendar that appears after the input date. More... | |
interface | getDateBefore |
Generate and return the date in the Gregorian Calendar that appears before the input date. More... | |
interface | getDateTime |
Generate and return the current or the requested date and time as an integer-valued array of size 8 or a formatted string.More... | |
interface | getDateTimeDiff |
Generate and return the calendarical difference in days between the two input Gregorian dates octuples (Values1(:) - Values2(:)). More... | |
interface | getDateTimeNewZone |
Generate and return the current or the requested date and time in the requested time zone newzone (in units of minutes) as an integer-valued array of size 8 .More... | |
interface | getDateTimeShifted |
Generate and return the current or the requested Gregorian date and time shifted by the specified amount in units of days. More... | |
interface | getDateTimeUTC |
Generate and return the current or the requested date and time converted to the corresponding Coordinated Universal Time (UTC) as an integer-valued array of size 8 . More... | |
interface | getHour12 |
Generate and return the current 12-hour-clock local hour of the current day of the Gregorian calendar. More... | |
interface | getJulianDay |
Generate and return the Julian Date (Julian Day Number JDN + the fractional part of the day) from the input [year, month, day, zone, hour, minute, second, millisecond] of the Gregorian calendar date. More... | |
interface | getOrdinalDay |
Generate and return the ordinal day, also knowns as Day of Year (DOY), i.e., the number of days since the beginning of the input year until and including the input Gregorian Calendar date [year, month, day] .More... | |
interface | getWeekDate |
Generate and return the ISO 8601 Week Date triple [week year, week number, week day] corresponding to the input Gregorian date and time values(1:3) or (year, month, day) triple. More... | |
interface | getWeekDay |
Generate and return the day number of the week of a Gregorian Calendar date, assuming Sunday is the zeroth day of the week. If there is no input argument, then the current day number of the week is returned. More... | |
interface | getWeekDayISO |
Generate and return the day number of the week of a Gregorian Calendar date, assuming Monday is the first day of the week. If there is no input argument, then the current day number of the week is returned. More... | |
interface | getWeekNumber |
Generate and return the Week Number, i.e., the number of weeks of the input year until and including the week containing the specified input Gregorian date. More... | |
interface | getWeekYear |
Generate and return the week year corresponding to the ISO 8601 Week Date triple [week year, week number, week day] equivalent of the input Gregorian date and time values(1:3) or (year, month, day) triple. More... | |
interface | getZoneAbbr |
Generate and return the time zone abbreviation corresponding to the current local time or the specified zone in minutes. More... | |
interface | isLastDayInMonth |
Generate and return .true. if the input date (year , month , day ) triple corresponds to the last day of a Gregorian Calendar month. More... | |
interface | isMorning |
Generate and return .true. if the hour in the current or the input time zone (-720 : +840) is Ante Meridiem (before noon). More... | |
interface | isValidDateTime |
Generate and return .true. if the input date and time values(:) or (year, month, day, zone, hour, second, millisecond) octuple corresponds to a valid Gregorian Calendar date and time. More... | |
interface | isValidZone |
Generate and return .true. is the input time zone zone in units of minutes is valid (i.e., -12 * 60 <= zone <= +14 * 60 ).More... | |
type | timeZone_type |
This is the derived type for generating object parameters containing a list of time zones and their representative abbreviations. More... | |
Functions/Subroutines | |
type(dateTimeInt_type) function | dateTimeInt_typer () |
This is the constructor of the dateTimeInt_type class. More... | |
integer(IK) function, dimension(8) | getDateTimeIntValues (self) |
Generate and return an integer vector of length 8 containing all component values of the parent object of type dateTimeInt_type. More... | |
type(dateTimeStr_type) function | dateTimeStr_typer () |
This is the constructor of the dateTimeStr_type class. More... | |
pure elemental logical(LK) function | isLeapYear (year) |
Generate and return .true. if the input year is a leap year. More... | |
integer(IK) function | getMillisecond () |
Generate and return the current millisecond of the current second of the current minute of the local hour of the current day of the Gregorian calendar. More... | |
integer(IK) function | getSecond () |
Generate and return the current second of the current minute of the local hour of the current day of the Gregorian calendar. More... | |
integer(IK) function | getMinute () |
Generate and return the current minute of the local hour of the current day of the Gregorian calendar. More... | |
impure elemental integer(IKG) function | getHour (zone) |
Generate and return the current local hour of the current day of the Gregorian calendar, or the hour at the specified time zone zone in minutes. More... | |
integer(IK) function | getZone () |
Generate and return the local time difference in minutes with respect to the Coordinated Universal Time (UTC). More... | |
integer(IK) function | getDay () |
Generate and return the current day of the Gregorian calendar. More... | |
integer(IK) function | getMonth () |
Generate and return the current month of the Gregorian calendar. More... | |
integer(IK) function | getYear () |
Generate and return the current year of the Gregorian calendar. More... | |
Variables | |
character(*, SK), parameter | MODULE_NAME = "@pm_dateTime" |
integer(IK), parameter | ZONE_MIN = -12_IK * 60_IK |
The scalar constant of default integer kind IK representing the current minimum existing time zone value in the work in units of minutes. More... | |
integer(IK), parameter | ZONE_MAX = +14_IK * 60_IK |
The scalar constant of default integer kind IK representing the current maximum existing time zone value in the work in units of minutes. More... | |
integer(IK), dimension(8), parameter | ORIGIN = [integer(IK) :: 1, 1, 1, 0, 0, 0, 0, 0] |
The constant vector of size 8 of type integer of default kind IK containing origin of the Gregorian calendar in the same format as returned by the values argument of the Fortran intrinsic date_and_time() . More... | |
character(9, SK), dimension(0:6), parameter | WEEKDAY_NAME = [ "Sunday " , "Monday " , "Tuesday " , "Wednesday" , "Thursday " , "Friday " , "Saturday " ] |
The character constant vector of shape (0:6) of length type parameter 9 containing the names of the days of a week assuming Sunday as the zeroth day of the week. More... | |
character(9, SK), dimension(1:7), parameter | WEEKDAY_NAME_ISO = [ "Monday " , "Tuesday " , "Wednesday" , "Thursday " , "Friday " , "Saturday " , "Sunday " ] |
The character constant vector of size 7 of length type parameter 9 containing the names of the days of a week. More... | |
character(*, SK), dimension(12), parameter | MONTH_NAME = [ "January " , "February " , "March " , "April " , "May " , "June " , "July " , "August " , "September" , "October " , "November " , "December " ] |
The character constant vector of size 12 of length type-parameter 9 , containing full names of the months of the Gregorian calendar. More... | |
integer(IK), dimension(12), parameter | DAYS_OF_MONTH = [integer(IK) :: 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |
The integer constant vector of size 12 containing number of days in each month of a common (non-leap) year of the Gregorian calendar. More... | |
integer(IK), dimension(12), parameter | DAYS_OF_MONTH_LEAP = [integer(IK) :: 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |
The integer constant vector of size 12 containing number of days in each month of a leap year of the Gregorian calendar. More... | |
integer(IK), parameter | SECONDS_PER_DAY = 86400_IK |
The constant scalar of type integer of kind IK containing the number of seconds per day. More... | |
integer(IK), parameter | MINUTES_PER_DAY = 1440_IK |
The constant scalar of type integer of kind IK containing the number of minutes per day. More... | |
real(RK), parameter | MEAN_DAYS_PER_MONTH = 0.25_RK * (0.25_RK * sum(DAYS_OF_MONTH) + sum(DAYS_OF_MONTH_LEAP) / 12._RK) |
The constant scalar of type real of default kind RK containing the average number of days per month. More... | |
real(RK), parameter | MEAN_WEEKS_PER_MONTH = MEAN_DAYS_PER_MONTH / 7._RK |
The constant scalar of type real of default kind RK containing the approximate (rounded) average number of weeks per month. More... | |
real(RK), parameter | MEAN_HOURS_PER_MONTH = 24_IK * MEAN_DAYS_PER_MONTH |
The constant scalar of type real of default kind RK containing the average number of hours per month. More... | |
real(RK), parameter | MEAN_MINUTES_PER_MONTH = 60_IK * MEAN_HOURS_PER_MONTH |
The constant scalar of type real of default kind RK containing the average number of minutes per month. More... | |
real(RK), parameter | MEAN_SECONDS_PER_MONTH = 60_IK * MEAN_MINUTES_PER_MONTH |
The constant scalar of type real of default kind RK containing the average number of seconds per month. More... | |
real(RK), parameter | MEAN_DAYS_PER_YEAR = 0.25_RK * (3 * 365 + 366) |
The constant scalar of type real of default kind RK containing the average number of days per year. More... | |
real(RK), parameter | MEAN_WEEKS_PER_YEAR = MEAN_DAYS_PER_YEAR / 7._RK |
The constant scalar of type real of default kind RK containing the approximate (rounded) average number of weeks per year. More... | |
real(RK), parameter | MEAN_HOURS_PER_YEAR = 24_IK * MEAN_DAYS_PER_YEAR |
The constant scalar of type real of default kind RK containing the average number of hours per year. More... | |
real(RK), parameter | MEAN_MINUTES_PER_YEAR = 60_IK * MEAN_HOURS_PER_YEAR |
The constant scalar of type real of default kind RK containing the average number of minutes per year. More... | |
real(RK), parameter | MEAN_SECONDS_PER_YEAR = 60_IK * MEAN_MINUTES_PER_YEAR |
The constant scalar of type real of default kind RK containing the average number of seconds per year. More... | |
type(timeZone_type), parameter | timeZone = timeZone_type() |
This is an object parameter of type timeZone_type containing a list of time zones and their representative abbreviations. More... | |
This module contains classes and procedures for computing, manipulating, and styling dates and times.
This module strives to follow the conventions of \(\ms{ISO 8601:2004}\).
A breif history of Julian Calendar and its evolution toward Gregorian calendar
The Calendar Requirements
65
days into the second year. This delay will propagate further into the following years and the third winter it will not start until 130
days into the third year. On the other hand, if the year is taken to be too many days, for example, 400
, the seasons will come earlier and earlier each year.365
or 366
, the slower the drift in seasons will occur, but it will not not eliminate it.A Historical Perspective
The Calendar of Romulus, \(\ms{753 BC}\)
30
or 31
days as follows:304
which is far less than the year length required to keep the seasons fixed.61
winter days unaccounted for that were not in any month.Calendar of Numa Pompilius, \(\ms{713 BC}\)
30
days so that they had 29
days instead.355
days in a common year and 377
days in a leap year.700
years.The Calendar of Julius Caesar in \(\ms{45 BC}\)
31
and 30
day counts in months.The Julian Calendar in \(\ms{44 BC}\)
16
centuries.31
-day month, same as Iulius.31
days as well, that would make three consecutive months with 31
days.The Gregorian Calendar in \(\ms{October 15, 1582 AD}\)
0.0078
days per year yields 1
day every 128
years or about 3
days every 400
years.10
days. The holidays were becoming noticeably misaligned with the seasons.10
days be stricken from the calendar.00
) not be leap years unless they are evenly divisible by 400
.3
fewer leap years every 400
years, which translates to 3
fewer days.10
days in the calendar starting \(\ms{October 5, 1582}\) until and including \(\ms{October 14, 1582}\).The Gregorian Calendar Error
1
day every 128
years.1
day every 3333
years.1
day in 4000
years.4000
, requiring the month of February of year 4000
to have only 28
days.1
day error in 20000
years (i.e., the seasons will shift by 1
day after 20000
years).The zeroth year and the Gregorian Calendar
A year zero does not exist in the Anno Domini (AD) calendar year system commonly used to number years in the Gregorian calendar (nor in its predecessor, the Julian calendar); in this system, the year \(\ms{1 BC}\) is followed directly by year \(\ms{AD 1}\).
However, there is a year zero in both the astronomical year numbering system (where it coincides with the Julian year \(\ms{1 BC}\)), and the \(\ms{ISO 8601:2004}\) international standard system. This is the interchange standard for all calendar numbering systems.
The \(\ms{ISO 8601:2004}\) convention for date and time explicitly requires year zero to coincide with the Gregorian year \(\ms{1 BC}\).
Gregorian year | ISO 8601 | Comments |
---|---|---|
10000 BC | −9999 | Beginning of the Holocene Era. |
9701 BC | −9700 | End of the Pleistocene and beginning of the Holocene epoch. |
4714 BC | −4713 | Epoch of the Julian day system: Julian day 0 starts at Greenwich noon on January 1, 4713 BC of the proleptic Julian calendar, which is November 24, 4714 BC in the proleptic Gregorian calendar. |
3761 BC | −3760 | Beginning of the Anno Mundi calendar era in the Hebrew calendar. |
3102 BC | −3101 | Beginning of the Kali Yuga in Hindu cosmology. |
2250 BC | −2249 | Beginning of the Meghalayan age, the current and latest of the three stages in the Holocene era. |
45 BC | −0044 | Introduction of the Julian calendar. |
1 BC | +0000 | Year zero at ISO 8601. |
AD 1 | +0001 | Beginning of the Common Era and Anno Domini, from the estimate by Dionysius of the Incarnation of Jesus. |
AD 622 | +0622 | Migration of Muhammad from Mecca to Medina (Hegira), starting the Islamic calendar. |
AD 1582 | +1582 | Introduction of the Gregorian calendar. |
AD 1912 | +1912 | Epoch of the Juche[13] and Minguo calendars. |
AD 1950 | +1950 | Epoch of the Before Present dating scheme. |
AD 1960 | +1960 | UTC Epoch. |
AD 1970 | +1970 | Unix Epoch. |
AD 1993 | +1993 | Publication of the Holocene calendar. |
AD 2022 | +2022 | The future. |
AD 10000 | +10000 | The distant future. |
The above information is partly based on the Wikipedia article Year Zero and the excellent historical review of the Julian Calendar by Stephen P. Morse.
lower
and upper
limit dates to Julian Days via getJulianDay().lowerJD
, upperJD
) by calling getUnifRand(lowerJD, upperJD).zone = 0
), then convert the uniformly randomly generated Julian Day (randJD
) to the Gregorian Calendar date by calling getDateTime(randJD).zone
, then convert the uniformly randomly generated Julian Day (randJD
) to the Gregorian Calendar date by calling getDateTime(randJD, zone).allocatable
output (e.g., getDateTime) should be added in the future.integer
kind and the default real64
real kind.date_and_time()
.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
type(dateTimeInt_type) function pm_dateTime::dateTimeInt_typer |
This is the constructor of the dateTimeInt_type class.
Upon return, the constructor initializes all components of the object to the current date and time.
See also the documentation details of dateTimeInt_type.
dateTimeInt
: The output scalar object of class dateTimeInt_type.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4092 of file pm_dateTime.F90.
type(dateTimeStr_type) function pm_dateTime::dateTimeStr_typer |
This is the constructor of the dateTimeStr_type class.
Upon return, the constructor initializes all components of the object to the current date and time.
See also the documentation details of dateTimeStr_type.
dateTimeStr
: The output scalar object of class dateTimeStr_type.
Possible calling interfaces ⛓
CHECK_ENABLED=1
.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4193 of file pm_dateTime.F90.
integer(IK) function, dimension(8) pm_dateTime::getDateTimeIntValues | ( | class(dateTimeInt_type), intent(in) | self | ) |
Generate and return an integer
vector of length 8
containing all component values of the parent object of type dateTimeInt_type.
This is a dynamic method of the dateTimeInt_type class.
See also the documentation details of dateTimeInt_type.
values
: The output vector of type integer
of default kind IK containing the values of all components of the parent object of class dateTimeInt_type as [year, month, day, zone, hour, minute, millisecond]
.values
argument of the Fortran intrinsic date_and_time()
.
Possible calling interfaces ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4144 of file pm_dateTime.F90.
integer(IK) function pm_dateTime::getDay |
Generate and return the current day of the Gregorian calendar.
day
: The output scalar of type integer
of default kind IK containing the current day of the Gregorian calendar.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4656 of file pm_dateTime.F90.
impure elemental integer(IKG) function pm_dateTime::getHour | ( | integer(IKG), intent(in), optional | zone | ) |
Generate and return the current local hour of the current day of the Gregorian calendar, or the hour at the specified time zone zone
in minutes.
[in] | zone | : The output scalar of type integer of default kind IK containing the time difference in minutes with respect to the Coordinated Universal Time (UTC). |
hour
: The output scalar of type integer
of default kind IK containing the current local hour of the current day of the Gregorian calendar.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4529 of file pm_dateTime.F90.
References pm_kind::IK.
integer(IK) function pm_dateTime::getMillisecond |
Generate and return the current millisecond of the current second of the current minute of the local hour of the current day of the Gregorian calendar.
second
: The output scalar of type integer
of default kind IK containing the current millisecond of the current second of the current minute of the local hour of the current day of the Gregorian calendar.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4345 of file pm_dateTime.F90.
integer(IK) function pm_dateTime::getMinute |
Generate and return the current minute of the local hour of the current day of the Gregorian calendar.
minute
: The output scalar of type integer
of default kind IK containing the current minute of the local hour of the current day of the Gregorian calendar.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4465 of file pm_dateTime.F90.
integer(IK) function pm_dateTime::getMonth |
Generate and return the current month of the Gregorian calendar.
month
: The output scalar of type integer
of default kind IK containing the current month of the Gregorian calendar.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4716 of file pm_dateTime.F90.
integer(IK) function pm_dateTime::getSecond |
Generate and return the current second of the current minute of the local hour of the current day of the Gregorian calendar.
second
: The output scalar of type integer
of default kind IK containing the current second of the current minute of the local hour of the current day of the Gregorian calendar.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4405 of file pm_dateTime.F90.
integer(IK) function pm_dateTime::getYear |
Generate and return the current year of the Gregorian calendar.
year
: The output scalar of type integer
of default kind IK containing the current year of the Gregorian calendar.
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4776 of file pm_dateTime.F90.
integer(IK) function pm_dateTime::getZone |
Generate and return the local time difference in minutes with respect to the Coordinated Universal Time (UTC).
zone
: The output scalar of type integer
of default kind IK containing the local time difference in minutes with respect to the Coordinated Universal Time (UTC).
Possible calling interfaces ⛓
-huge(0_K)
if the processor does not provide date and time.CHECK_ENABLED=1
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4596 of file pm_dateTime.F90.
pure elemental logical(LK) function pm_dateTime::isLeapYear | ( | integer(IK), intent(in) | year | ) |
Generate and return .true.
if the input year is a leap year.
To be a leap year, the year number must be divisible by four – except for end-of-century years, which must be divisible by 400.
For BC, counting starts at 1
, so there is no year 0
. This means that the leap years are offset by 1
and can be calculated by the same method as above, but with the year number increased by 1.
For example, the year 2000 was a leap year, although 1900 was not.
The years 2020, 2024 and 2028 are all leap years.
[in] | year | : The input scalar or array of arbitrary shape of type integer of default kind IK containing the (possibly proleptic) Gregorian calendar year(s). |
leapYear
: The output object of the same rank and shape as the input year
, of type logical
of default kind LK. It is .true.
if and only if the corresponding input year is a leap year.
Possible calling interfaces ⛓
pure
.elemental
.year = 0
corresponds to the historic 1 BC notation of the Gregorian calendar.0
is a leap year.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 4279 of file pm_dateTime.F90.
integer(IK), dimension(12), parameter pm_dateTime::DAYS_OF_MONTH = [integer(IK) :: 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |
The integer
constant vector of size 12
containing number of days in each month of a common (non-leap) year of the Gregorian calendar.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 493 of file pm_dateTime.F90.
integer(IK), dimension(12), parameter pm_dateTime::DAYS_OF_MONTH_LEAP = [integer(IK) :: 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |
The integer
constant vector of size 12
containing number of days in each month of a leap year of the Gregorian calendar.
Only the month of February becomes one day longer in the leap years.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 523 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_DAYS_PER_MONTH = 0.25_RK * (0.25_RK * sum(DAYS_OF_MONTH) + sum(DAYS_OF_MONTH_LEAP) / 12._RK) |
The constant scalar of type real
of default kind RK containing the average number of days per month.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 586 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_DAYS_PER_YEAR = 0.25_RK * (3 * 365 + 366) |
The constant scalar of type real
of default kind RK containing the average number of days per year.
This number takes into account the leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 731 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_HOURS_PER_MONTH = 24_IK * MEAN_DAYS_PER_MONTH |
The constant scalar of type real
of default kind RK containing the average number of hours per month.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 644 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_HOURS_PER_YEAR = 24_IK * MEAN_DAYS_PER_YEAR |
The constant scalar of type real
of default kind RK containing the average number of hours per year.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 789 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_MINUTES_PER_MONTH = 60_IK * MEAN_HOURS_PER_MONTH |
The constant scalar of type real
of default kind RK containing the average number of minutes per month.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 673 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_MINUTES_PER_YEAR = 60_IK * MEAN_HOURS_PER_YEAR |
The constant scalar of type real
of default kind RK containing the average number of minutes per year.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 818 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_SECONDS_PER_MONTH = 60_IK * MEAN_MINUTES_PER_MONTH |
The constant scalar of type real
of default kind RK containing the average number of seconds per month.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 702 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_SECONDS_PER_YEAR = 60_IK * MEAN_MINUTES_PER_YEAR |
The constant scalar of type real
of default kind RK containing the average number of seconds per year.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 847 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_WEEKS_PER_MONTH = MEAN_DAYS_PER_MONTH / 7._RK |
The constant scalar of type real
of default kind RK containing the approximate (rounded) average number of weeks per month.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 615 of file pm_dateTime.F90.
real(RK), parameter pm_dateTime::MEAN_WEEKS_PER_YEAR = MEAN_DAYS_PER_YEAR / 7._RK |
The constant scalar of type real
of default kind RK containing the approximate (rounded) average number of weeks per year.
This number takes into account the different length of the February
month in leap years.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 760 of file pm_dateTime.F90.
integer(IK), parameter pm_dateTime::MINUTES_PER_DAY = 1440_IK |
The constant scalar of type integer
of kind IK containing the number of minutes per day.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 557 of file pm_dateTime.F90.
character(*, SK), parameter pm_dateTime::MODULE_NAME = "@pm_dateTime" |
Definition at line 317 of file pm_dateTime.F90.
character(*, SK), dimension(12), parameter pm_dateTime::MONTH_NAME = [ "January " , "February " , "March " , "April " , "May " , "June " , "July " , "August " , "September" , "October " , "November " , "December " ] |
The character
constant vector of size 12
of length type-parameter 9
, containing full names of the months of the Gregorian calendar.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 455 of file pm_dateTime.F90.
integer(IK), dimension(8), parameter pm_dateTime::ORIGIN = [integer(IK) :: 1, 1, 1, 0, 0, 0, 0, 0] |
The constant vector of size 8
of type integer
of default kind IK containing origin of the Gregorian calendar in the same format as returned by the values
argument of the Fortran intrinsic date_and_time()
.
This date corresponds to the midnight of the first day of January of year 1
AD.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 347 of file pm_dateTime.F90.
integer(IK), parameter pm_dateTime::SECONDS_PER_DAY = 86400_IK |
The constant scalar of type integer
of kind IK containing the number of seconds per day.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 540 of file pm_dateTime.F90.
Referenced by pm_timer::getTimeDAT().
type(timeZone_type), parameter pm_dateTime::timeZone = timeZone_type() |
This is an object parameter of type timeZone_type containing a list of time zones and their representative abbreviations.
This list contains only a representative set of zone abbreviations.
See the documentation of timeZone_type for more information.
See the documentation of getZoneAbbr for relevant usage and examples.
The primary use case of this object is in the implementation of getZoneAbbr().
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 1184 of file pm_dateTime.F90.
character(9,SK), dimension(0:6), parameter pm_dateTime::WEEKDAY_NAME = [ "Sunday " , "Monday " , "Tuesday " , "Wednesday" , "Thursday " , "Friday " , "Saturday " ] |
The character
constant vector of shape (0:6)
of length type parameter 9
containing the names of the days of a week assuming Sunday as the zeroth day of the week.
(1:3)
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 382 of file pm_dateTime.F90.
character(9,SK), dimension(1:7), parameter pm_dateTime::WEEKDAY_NAME_ISO = [ "Monday " , "Tuesday " , "Wednesday" , "Thursday " , "Friday " , "Saturday " , "Sunday " ] |
The character
constant vector of size 7
of length type parameter 9
containing the names of the days of a week.
Following ISO 8601 convention, the first day of the week is Monday.
(1:3)
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 421 of file pm_dateTime.F90.
integer(IK), parameter pm_dateTime::ZONE_MAX = +14_IK * 60_IK |
The scalar constant of default integer
kind IK representing the current maximum existing time zone value in the work in units of minutes.
Definition at line 326 of file pm_dateTime.F90.
integer(IK), parameter pm_dateTime::ZONE_MIN = -12_IK * 60_IK |
The scalar constant of default integer
kind IK representing the current minimum existing time zone value in the work in units of minutes.
Definition at line 321 of file pm_dateTime.F90.