ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_dateTime Module Reference

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...
 

Detailed Description

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}\).

  1. \(\ms{ISO 8601:2004}\)
    1. The International Organization for Standardization (ISO) is the regulator of \(\ms{ISO 8601:2004}\), which is the international standard for covering the exchange of data related to date or time.
    2. Though it is used by the majority of the world, especially developed, not all adhere to this standard.
  2. Gregorian Calendar
    1. The Gregorian Calendar, named after Pope Gregory XIII, is based on the time it takes the moon to make one full revolution around the Earth (roughly one month) and the Sun to make a full revolution around the Earth (roughly one year).
    2. Because celestial bodies of such close proximity can be widely encountered, it was common in ancient times to use them to tell time and/or date. This method was further refined into what we now know as the current Gregorian Calendar.

A breif history of Julian Calendar and its evolution toward Gregorian calendar

  1. The Julian calendar is important to historians because it was used worldwide for over 16 centuries, and in various parts of the world for another three centuries after that.
  2. It is also important to genealogists because it was used to record events in many countries as recently as the early 1900s.
  3. There are several subtle but significant differences between the Julian Calendar and its successor that is currently used (the Gregorian Calendar.
    For example, the birthday of George Washington is conventionally celebrated on February 22. However, as a result of the switch from the Julian calendar to the Gregorian, his birthday was in fact February 23 in the 19th century, February 24th in the 20th and 21st century, and will continue to advance in future centuries.

The Calendar Requirements

  1. The calendar has only one basic requirement – that the seasons do not migrate through the years.
    For example, We are used to going to the beach in July, and if after a few years it does not warm up sufficiently until November we might not be too happy.
  2. The seasons are determined by the position of the Earth in its orbit around the sun.
  3. Earth goes around the sun once every \(\ms{365.2422}\) days.
  4. The fractional part of the year \(\ms{.2422}\) in units of days makes the design of precise calendars very difficult.
  5. Since it is not desired to start a new year after a fractional number of days, the compromise is to pick some integral number of days that is close to \(\ms{365.2422}\).
  6. Picking an integral year length that is too low will shift the seasons to later and later times each year.
    For example, if the year is taken to be 300 days, the earth will not yet have reached the correct point in its orbit for the winter next year and the winter season will not start until 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.
  7. The closer the chosen length of the year is to the magical number \(\ms{365.2422}\), such as 365 or 366, the slower the drift in seasons will occur, but it will not not eliminate it.
    If we wait long enough, even the best designed calendar will start to experience drift.

A Historical Perspective

  1. The seeds of the current Gregorian calendar lie in the calendars used in ancient Rome.

The Calendar of Romulus, \(\ms{753 BC}\)

  1. The first Roman calendar was introduced in approximately \(\ms{753 BC}\) by Romulus, the first king of Rome.
  2. The calendar of Romulus had only ten months with each month having either 30 or 31 days as follows:
    1. Martius – 31 days
    2. Aprilis – 30 days
    3. Maius – 31 days
    4. Iunius – 30 days
    5. Quintilis – 31 days
    6. Sextilis – 30 days
    7. September – 30 days
    8. October – 31 days
    9. November – 30 days
    10. December – 30 days
  3. It is not clear where the name Aprilis came from, but the other three of the first four months were named after Roman gods.
  4. Starting with the fifth month, the names reflect the order of the month in the calendar: Quintilis (meaning five in Latin), Sextilis (meaning six), ..., to December (meaning ten).
  5. The total number of days in the ten months was 304 which is far less than the year length required to keep the seasons fixed.
  6. People had to wait around until astronomers determined that it was time to start the next year.
  7. This ancient calendar system left about 61 winter days unaccounted for that were not in any month.

Calendar of Numa Pompilius, \(\ms{713 BC}\)

  1. By \(\ms{713 BC}\) the calendar was modified by Numa Pompilius, the second king of Rome.
  2. Pompilius added two months at the end of the calendar, Ianuarius and Februarius to compensate for the unaccounted-for days.
  3. Pompilius also introduced an intercalary month that occurred after Februarius in certain years. These years became known as leap years.
  4. Pompilius also deleted one day from all the months that had 30 days so that they had 29 days instead.
    1. Martius – 31 days
    2. Aprilis – 29 days
    3. Maius – 31 days
    4. Iunius – 29 days
    5. Quintilis – 31 days
    6. Sextilis – 29 days
    7. September – 29 days
    8. October – 31 days
    9. November – 29 days
    10. December – 29 days
    11. Ianuarius – 29 days
    12. Februarius – 28 days (23 or 24 days in leap year)
    13. Intercalarius – 0 days (27 days in leap year)
  5. This resulted in a total of 355 days in a common year and 377 days in a leap year.
  6. This required to have a leap year just about every other year.
  7. However, the Numa Calendar did not have a hard and fast rule to keep up with the leap years.
    Instead it was left to the whim of the king, who would frequently choose the leap years for political gain rather than for sound astronomical reasons.
  8. The lack of hard rules for the leap years made the Numa Calendar unstable, although it remained in widespread usage for the next 700 years.
  9. By sometime around or before \(\ms{450 BC}\) the starting point of the calendar was shifted from Martius to Ianuarius.
    All other aspects of the calendar remained the same, so it was still effectively the Numa calendar.
  10. This change of starting point resulted in month names that are now misnomers, no longer corresponding to their position in the calendar.
  11. The Numa Calendar in \(\ms{450 BC}\) was as follows:
    1. Ianuarius – 29 days
    2. Februarius – 28 days (23 or 24 days in leap year)
    3. Intercalarius – 0 days (27 days in leap year)
    4. Martius – 31 days
    5. Aprilis – 29 days
    6. Maius – 31 days
    7. Iunius – 29 days
    8. Quintilis – 31 days
    9. Sextilis – 29 days
    10. September – 29 days
    11. October – 31 days
    12. November – 29 days
    13. December – 29 days

The Calendar of Julius Caesar in \(\ms{45 BC}\)

  1. Eventually the abuse of the leap years in the Numa Calendar became so egregious that the harvest festival was came before the summer planting season.
  2. Therefore, in \(\ms{45 BC}\) Julius Caesar reformed the calendar and introduced the first stable calendar.
  3. Caesar incorporated fixed rules for determining which years were leap years.
  4. Caesar also eliminated the intercalary month and replaced it with a single intercalary day.
  5. Caesar also introduced a regular pattern of alternating 31 and 30 day counts in months.
  6. Caesar also did a one-time insertion of three months in the year \(\ms{46 BC}\) to give the seasons a chance to catch up.
  7. The calendar of Julius Caesar is as follows:
    1. Ianuarius – 31 days
    2. Februarius – 29 days (30 days in leap year)
    3. Martius – 31 days
    4. Aprilis – 30 days
    5. Maius – 31 days
    6. Iunius – 30 days
    7. Quintilis – 31 days
    8. Sextilis – 30 days
    9. September – 31 days
    10. October – 30 days
    11. November – 31 days
    12. December – 30 days
  8. The calendar of Julius Caesar required that every third year shall be a leap year.
  9. It is believed that Julius intended for it to be every fourth year but the people who implemented it made a calculation error in the way they counted to four (the so-called fence-post error).
  10. In spite of the leap-year error, every year of the calendar was now \(\ms{365.3333}\) days on average, a number very close to the correct number of \(\ms{365.2422}\).

The Julian Calendar in \(\ms{44 BC}\)

  1. Julius Caesar was killed on the Ides of Martius (March 15) in \(\ms{44 BC}\), one year after his calendar went into effect.
  2. The successor to Julius Caesar, Augustus Caesar, made some refinements to the calendar.
  3. The changes introduced by Augustus created a stable calendar known as the Julian calendar which was used world-wide for the next 16 centuries.
  4. Augustus changed the leap-year cycle to every four years instead of every three.
  5. Augustus also renamed Quintilis to Iulius, to honor his predecessor, Julius Caesar.
  6. Augustus also decided to give homage to himself by changing Sextilis to Augustus.
  7. However, the month of Augustus had one fewer day than the month of Julius Caesar which made Augustus unhappy.
  8. Therefore, Augustus also removed a day from Februarius and added it to Augustus, making it a 31-day month, same as Iulius.
  9. But since September had 31 days as well, that would make three consecutive months with 31 days.
  10. Hence, Augustus also interchanged the number of days in September and October, as well as interchanging the number of days in November and December.
  11. The revised calendar of Augustus (the Julian Calendar) is as follows:
    1. Ianuarius – 31 days
    2. Februarius – 28 days (29 days in leap year)
    3. Martius – 31 days
    4. Aprilis – 30 days
    5. Maius – 31 days
    6. Iunius – 30 days
    7. Iulius – 31 days
    8. Augustus – 31 days
    9. September – 30 days
    10. October – 31 days
    11. November – 30 days
    12. December – 31 days
  12. The above names and number of days of the months of the Julian Calendar remain the same up to the present day.
  13. Augustus also corrected the fence-post error by requiring three-year cycle for leap years.

The Gregorian Calendar in \(\ms{October 15, 1582 AD}\)

  1. The leap-year correction introduced by Augustus led to a Julian calendar that had an average of \(\ms{365.25}\) days per year.
  2. However, the corrected year length was still slightly off the true number of \(\ms{365.2422}\).
  3. A difference of 0.0078 days per year yields 1 day every 128 years or about 3 days every 400 years.
  4. By the 1500s, the Julian Calendar error amounted to about 10 days. The holidays were becoming noticeably misaligned with the seasons.
  5. To get back in step, Pope Gregory XIII decreed in October 1582 that 10 days be stricken from the calendar.
  6. Furthermore, Pope Gregory XIII required that century years (those ending in 00) not be leap years unless they are evenly divisible by 400.
  7. The second correction by Pope Gregory XIII implies that there would be 3 fewer leap years every 400 years, which translates to 3 fewer days.
  8. These corrections compensated for the accumulated errors of the Julian Calendar and made sure the corrections would remain in place for the foreseeable future.
  9. Finally, Pope Gregory XIII decreed that the cutover date for the calendar should be \(\ms{October 4, 1582}\).
  10. The calendar with the above three fixes has become known as the Gregorian Calendar which is in widespread use in modern world.
  11. Overall, Pope Gregory XIII striked a total of 10 days in the calendar starting \(\ms{October 5, 1582}\) until and including \(\ms{October 14, 1582}\).
  12. On the day of the Gregorian Calendar cutover \(\ms{October 4, 1582}\), the Catholic world (including Italy, Poland, Portugal, and Spain) was eager to follow the new calendar and all switched over to the Gregorian Calendar.
  13. By the end of that year France, Holland, and part of Belgium made the switch.
  14. The following year Austria, the rest of Belgium, and Catholic Germany fell in line.
  15. And they were joined by Czechoslovakia and Catholic Switzerland in 1584, Hungary in 1587, and Transylvania in 1590.
  16. The Protestant and Greek Orthodox countries did not immediately switch:
    1. Germany switched piecemeal during the 1600s.
    2. Denmark, Iceland, the rest of the Netherlands, Norway, and Protestant Switzerland switched in the year 1700.
    3. Canada, Great Britain, Ireland, and the eastern US switched in 1752.
    4. Japan switched in 1873 and Egypt in 1875.
    5. Then between 1911 and 1923 Albania, Bulgaria, China, Estonia, Greece, Latvia, Lithuania, Romania, Russia, and Yugoslavia all switched over.
    6. Finally Turkey switched in 1927.
  17. The cutover was not simultaneous either within the United States mainland.
  18. The calendar switch in the US depended on which country the specific territory was owned by:
    1. Texas, Florida, California, Nevada, Arizona, and New Mexico all switched with Spain in 1582.
    2. Mississippi switched with France in 1582.
    3. The eastern seaboard switched with Great Britain in 1752.
    4. Alaska switched in 1867 when it became part of the US.
  19. In an attempt to have a gradual conversion, Sweden decided not to have leap years from 1700 to 1740.
    This implied that there would be no jolt to the calendar.
    But after skipping the leap year in 1700, they abandoned the plan. This put Sweden out of step with both the Julian and Gregorian calendars.
    In 1712 Sweden reverted back to the Julian calendar by having 30 days in February that year to make up for the leap day that they missed in 1700.
    Then in 1753 Sweden gave up and switched all-at-once to the Gregorian calendar.
  20. Despite all switching, the Julian calendar is still used in parts of the world.
    For example, it is used by Eastern Orthodox Church for calculating Easter and other feasts, by the Berber people in North Africa and on Mount Athos.
    Also, Ethiopia uses the Alexandrian calendar which is based on the Julian calendar.

The Gregorian Calendar Error

  1. As mentioned above, the average Julian year is \(\ms{365.25}\) days while the true length of a year is \(\ms{365.2422}\) days.
    The difference caused the Julian seasons to advance 1 day every 128 years.
  2. The **average Gregorian year is \(\ms{365.2425}\) days** which causes the seasons to advance 1 day every 3333 years.
  3. The Gregorian Calendar error is about 1 day in 4000 years.
  4. The Gregorian Calendar error can be readily fixed by skipping the leap years in millennium years that are divisible by 4000, requiring the month of February of year 4000 to have only 28 days.
  5. However, there is currently no official fix introduced for the Gregorian Calendar.
  6. The fix to the Gregorian Calendar error will make the average length of the modified Gregorian Calendar year \(\ms{365.24225}\).
  7. Therefore, the corrected Gregorian Calendar would have only a 1 day error in 20000 years (i.e., the seasons will shift by 1 day after 20000 years).
  8. Any further fix to the modified Gregorian Calendar is likely effectively useless, since the error becomes comparable to the natural variations in the magic number \(\ms{365.2422}\) (the number of days Earth takes to orbit the Sun).

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.

Note
If you ever need to generate uniformly-distributed random Gregorian calendar dates between two specified dates,
  1. Convert the lower and upper limit dates to Julian Days via getJulianDay().
  2. Generate a random Julian Day within the computed lower and upper Julian Day limits (lowerJD, upperJD) by calling getUnifRand(lowerJD, upperJD).
    • Should the uniformly randomly generated Gregorian Calendar date be a UTC date and time (i.e., zone = 0), then convert the uniformly randomly generated Julian Day (randJD) to the Gregorian Calendar date by calling getDateTime(randJD).
    • Should the uniformly randomly generated Gregorian Calendar date be local to a specific time zone zone, then convert the uniformly randomly generated Julian Day (randJD) to the Gregorian Calendar date by calling getDateTime(randJD, zone).
Here is an example:
use pm_kind, only: RKG => RK, IKG => IK
integer(IKG) :: DateRand(8)
DateRand = getDateTime(julianDay = getUnifRand(-300000._RKG, +300000._RKG))
DateRand = getDateTime(julianDay = getUnifRand(getJulianDay(1_IK), getJulianDay())) ! uniform random date from the birth of Jesus until present.
!
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
See also
M_time
datetime-fortran
Test:
test_pm_dateTime
Todo:
A subroutine equivalent of the performance-critical functions with allocatable output (e.g., getDateTime) should be added in the future.
Todo:
High Priority: Most of the routines of this module are currently implemented for the default integer kind and the default real64 real kind.
The choice of kinds is primarily dictated by the output of the Fortran intrinsic date_and_time().
All routines should be extended to generic interfaces supporting multiple kinds in future.


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Function/Subroutine Documentation

◆ dateTimeInt_typer()

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.

Returns
dateTimeInt : The output scalar object of class dateTimeInt_type.


Possible calling interfaces

type(dateTimeInt_type) :: dateTimeInt
dateTimeInt = dateTimeInt_type()
This module contains classes and procedures for computing, manipulating, and styling dates and times.
This is the derived type containing the components of a numeric date and time in the Gregorian calend...
Warning
All object components are set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
Remarks
See the documentation of dateTimeInt_type for example usage.


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 4092 of file pm_dateTime.F90.

◆ dateTimeStr_typer()

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.

Returns
dateTimeStr : The output scalar object of class dateTimeStr_type.


Possible calling interfaces

type(dateTimeStr_type) :: dateTimeStr
dateTimeStr = dateTimeStr_type()
This is the derived type containing the string components that contain numeric date and time in the G...
Warning
All object components are set to blanks if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
Remarks
See the documentation of dateTimeStr_type for example usage.


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 4193 of file pm_dateTime.F90.

◆ getDateTimeIntValues()

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.

Returns
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].
The format of the output vector conforms with the format of the output values argument of the Fortran intrinsic date_and_time().


Possible calling interfaces

type(dateTimeInt_type) :: dateTimeInt
dateTimeInt = dateTimeInt_type()
Remarks
See the documentation of dateTimeInt_type for example usage.


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 4144 of file pm_dateTime.F90.

◆ getDay()

integer(IK) function pm_dateTime::getDay

Generate and return the current day of the Gregorian calendar.

Returns
day : The output scalar of type integer of default kind IK containing the current day of the Gregorian calendar.


Possible calling interfaces

use pm_dateTime, only: getDay
integer(IK) :: day
day = getDay()
integer(IK) function getDay()
Generate and return the current day of the Gregorian calendar.
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getDay
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getDay()")
14 call disp%show( getDay() )
15 call disp%skip()
16
17end program example
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2getDay()
3+27
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4656 of file pm_dateTime.F90.

◆ getHour()

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.

Parameters
[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).
Returns
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

use pm_dateTime, only: getHour
integer(IK) :: hour
hour = getHour() ! current hour at local time zone
hour = getHour(zone) ! current hour at the specified time zone in minutes
!
impure elemental integer(IKG) function getHour(zone)
Generate and return the current local hour of the current day of the Gregorian calendar,...
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getHour
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getHour()")
14 call disp%show( getHour() )
15 call disp%skip()
16
17end program example

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+22
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4529 of file pm_dateTime.F90.

References pm_kind::IK.

◆ getMillisecond()

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.

Returns
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

integer(IK) :: millisecond
millisecond = getSecond()
integer(IK) function getMillisecond()
Generate and return the current millisecond of the current second of the current minute of the local ...
integer(IK) function getSecond()
Generate and return the current second of the current minute of the local hour of the current day of ...
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getMilliSecond
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getMilliSecond()")
14 call disp%show( getMilliSecond() )
15 call disp%skip()
16
17end program example

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2getMilliSecond()
3+856
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4345 of file pm_dateTime.F90.

◆ getMinute()

integer(IK) function pm_dateTime::getMinute

Generate and return the current minute of the local hour of the current day of the Gregorian calendar.

Returns
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

integer(IK) :: minute
minute = getMinute()
integer(IK) function getMinute()
Generate and return the current minute of the local hour of the current day of the Gregorian calendar...
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getMinute
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getMinute()")
14 call disp%show( getMinute() )
15 call disp%skip()
16
17end program example

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+32
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4465 of file pm_dateTime.F90.

◆ getMonth()

integer(IK) function pm_dateTime::getMonth

Generate and return the current month of the Gregorian calendar.

Returns
month : The output scalar of type integer of default kind IK containing the current month of the Gregorian calendar.


Possible calling interfaces

integer(IK) :: month
month = getMonth()
integer(IK) function getMonth()
Generate and return the current month of the Gregorian calendar.
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getMonth
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getMonth()")
14 call disp%show( getMonth() )
15 call disp%skip()
16
17end program example

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+10
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4716 of file pm_dateTime.F90.

◆ getSecond()

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.

Returns
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

integer(IK) :: second
second = getSecond()
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getSecond
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getSecond()")
14 call disp%show( getSecond() )
15 call disp%skip()
16
17end program example

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+36
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4405 of file pm_dateTime.F90.

◆ getYear()

integer(IK) function pm_dateTime::getYear

Generate and return the current year of the Gregorian calendar.

Returns
year : The output scalar of type integer of default kind IK containing the current year of the Gregorian calendar.


Possible calling interfaces

use pm_dateTime, only: getYear
integer(IK) :: year
year = getYear()
integer(IK) function getYear()
Generate and return the current year of the Gregorian calendar.
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getYear
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getYear()")
14 call disp%show( getYear() )
15 call disp%skip()
16
17end program example

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+2024
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4776 of file pm_dateTime.F90.

◆ getZone()

integer(IK) function pm_dateTime::getZone

Generate and return the local time difference in minutes with respect to the Coordinated Universal Time (UTC).

Returns
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

use pm_dateTime, only: getZone
integer(IK) :: zone
zone = getZone()
integer(IK) function getZone()
Generate and return the local time difference in minutes with respect to the Coordinated Universal Ti...
Warning
The output value is set to -huge(0_K) if the processor does not provide date and time.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_dateTime, only: getZone
6 use pm_val2str, only: getStr
7
8 implicit none
9
10 type(display_type) :: disp
11 disp = display_type(file = "main.out.F90")
12
13 call disp%skip()
14 call disp%show("SK_'The local time difference with respect to UTC is '//getStr(getZone())//SK_' minutes.'")
15 call disp%show( SK_'The local time difference with respect to UTC is '//getStr(getZone())//SK_' minutes.' )
16 call disp%skip()
17
18end program example
Generate and return the conversion of the input value to an output Fortran string,...
Definition: pm_val2str.F90:167
This module contains the generic procedures for converting values of different types and kinds to For...
Definition: pm_val2str.F90:58

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2SK_'The local time difference with respect to UTC is '//getStr(getZone())//SK_' minutes.'
3The local time difference with respect to UTC is -300 minutes.
4
5
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4596 of file pm_dateTime.F90.

◆ isLeapYear()

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.

Parameters
[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).
Returns
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

logical(LK) :: leapYear
integer(IK) :: year
leapYear = isLeapYear(year)
pure elemental logical(LK) function isLeapYear(year)
Generate and return .true. if the input year is a leap year.
Remarks
The procedures under discussion are pure.
The procedures under discussion are elemental.
Warning
An input argument year = 0 corresponds to the historic 1 BC notation of the Gregorian calendar.
This is in accordance with the convention in astronomical year numbering and the international standard date system, ISO 8601.
In these systems, the year 0 is a leap year.
See also
getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 call disp%skip()
13 call disp%show("getYear()")
14 call disp%show( getYear() )
15 call disp%show("isLeapYear(getYear())")
16 call disp%show( isLeapYear(getYear()) )
17 call disp%skip()
18
19 call disp%skip()
20 call disp%show("isLeapYear(2000_IK)")
21 call disp%show( isLeapYear(2000_IK) )
22 call disp%skip()
23
24 call disp%skip()
25 call disp%show("isLeapYear(2024_IK)")
26 call disp%show( isLeapYear(2024_IK) )
27 call disp%skip()
28
29 call disp%skip()
30 call disp%show("isLeapYear([1_IK, 2_IK, 3_IK, 4_IK])")
31 call disp%show( isLeapYear([1_IK, 2_IK, 3_IK, 4_IK]) )
32 call disp%skip()
33
34 call disp%skip()
35 call disp%show("isLeapYear(-[1_IK, 2_IK, 3_IK, 4_IK])")
36 call disp%show( isLeapYear(-[1_IK, 2_IK, 3_IK, 4_IK]) )
37 call disp%skip()
38
39end program example

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+2024
5T
6
7
8isLeapYear(2000_IK)
9T
10
11
12isLeapYear(2024_IK)
13T
14
15
16isLeapYear([1_IK, 2_IK, 3_IK, 4_IK])
17F, F, F, T
18
19
20isLeapYear(-[1_IK, 2_IK, 3_IK, 4_IK])
21F, F, F, T
22
23
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 4279 of file pm_dateTime.F90.

Variable Documentation

◆ DAYS_OF_MONTH

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.

See also
getCountDays


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
6
7 implicit none
8
9 integer :: i
10 type(display_type) :: disp
11 disp = display_type(file = "main.out.F90")
12
13 call disp%skip()
14 call disp%show("DAYS_OF_MONTH")
15 call disp%show( DAYS_OF_MONTH )
16 call disp%skip()
17
18 call disp%skip()
19 call disp%show("sum(DAYS_OF_MONTH)")
20 call disp%show( sum(DAYS_OF_MONTH) )
21 call disp%skip()
22
23end program example
integer(IK), dimension(12), parameter DAYS_OF_MONTH
The integer constant vector of size 12 containing number of days in each month of a common (non-leap)...

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+31, +28, +31, +30, +31, +30, +31, +31, +30, +31, +30, +31
4
5
7+365
8
9
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 493 of file pm_dateTime.F90.

◆ DAYS_OF_MONTH_LEAP

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.

See also
isLeapYear
getCountDays


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
6
7 implicit none
8
9 integer :: i
10 type(display_type) :: disp
11 disp = display_type(file = "main.out.F90")
12
13 call disp%skip()
14 call disp%show("DAYS_OF_MONTH_LEAP")
16 call disp%skip()
17
18 call disp%skip()
19 call disp%show("sum(DAYS_OF_MONTH_LEAP)")
20 call disp%show( sum(DAYS_OF_MONTH_LEAP) )
21 call disp%skip()
22
23end program example
integer(IK), dimension(12), parameter DAYS_OF_MONTH_LEAP
The integer constant vector of size 12 containing number of days in each month of a leap year of the ...

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3+31, +29, +31, +30, +31, +30, +31, +31, +30, +31, +30, +31
4
5
7+366
8
9
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 523 of file pm_dateTime.F90.

◆ MEAN_DAYS_PER_MONTH

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 586 of file pm_dateTime.F90.

◆ MEAN_DAYS_PER_YEAR

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 731 of file pm_dateTime.F90.

◆ MEAN_HOURS_PER_MONTH

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 644 of file pm_dateTime.F90.

◆ MEAN_HOURS_PER_YEAR

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 789 of file pm_dateTime.F90.

◆ MEAN_MINUTES_PER_MONTH

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 673 of file pm_dateTime.F90.

◆ MEAN_MINUTES_PER_YEAR

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 818 of file pm_dateTime.F90.

◆ MEAN_SECONDS_PER_MONTH

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 702 of file pm_dateTime.F90.

◆ MEAN_SECONDS_PER_YEAR

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 847 of file pm_dateTime.F90.

◆ MEAN_WEEKS_PER_MONTH

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 615 of file pm_dateTime.F90.

◆ MEAN_WEEKS_PER_YEAR

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.

See also
MEAN_DAYS_PER_MONTH
MEAN_WEEKS_PER_MONTH
MEAN_HOURS_PER_MONTH
MEAN_MINUTES_PER_MONTH
MEAN_SECONDS_PER_MONTH
MEAN_DAYS_PER_YEAR
MEAN_WEEKS_PER_YEAR
MEAN_HOURS_PER_YEAR
MEAN_MINUTES_PER_YEAR
MEAN_SECONDS_PER_YEAR


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 760 of file pm_dateTime.F90.

◆ MINUTES_PER_DAY

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.

See also
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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 557 of file pm_dateTime.F90.

◆ MODULE_NAME

character(*, SK), parameter pm_dateTime::MODULE_NAME = "@pm_dateTime"

Definition at line 317 of file pm_dateTime.F90.

◆ MONTH_NAME

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.

See also
getMonth


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
6
7 implicit none
8
9 integer :: i
10 type(display_type) :: disp
11 disp = display_type(file = "main.out.F90")
12
13 call disp%skip()
14 call disp%show("MONTH_NAME")
15 call disp%show( MONTH_NAME , deliml = SK_"""" )
16 call disp%skip()
17
18 call disp%skip()
19 call disp%show("getMonth()")
20 call disp%show( getMonth() )
21 call disp%show("trim(MONTH_NAME(getMonth()))")
22 call disp%show( trim(MONTH_NAME(getMonth())) , deliml = SK_"""" )
23 call disp%skip()
24
25 call disp%skip()
26 call disp%show("getMonth()")
27 call disp%show( getMonth() )
28 call disp%show("MONTH_NAME(getMonth())(1:3)")
29 call disp%show( MONTH_NAME(getMonth())(1:3) , deliml = SK_"""" )
30 call disp%skip()
31
32 call disp%skip()
33 call disp%show("[( MONTH_NAME(i)(1:3), i = 1, 12 )]")
34 call disp%show( [( MONTH_NAME(i)(1:3), i = 1, 12 )] , deliml = SK_"""" )
35 call disp%skip()
36
37end program example
character(*, SK), dimension(12), parameter MONTH_NAME
The character constant vector of size 12 of length type-parameter 9, containing full names of the mon...

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3"January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September", "October ", "November ", "December "
4
5
7+10
8trim(MONTH_NAME(getMonth()))
9"October"
10
11
13+10
14MONTH_NAME(getMonth())(1:3)
15"Oct"
16
17
18[( MONTH_NAME(i)(1:3), i = 1, 12 )]
19"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
20
21
Test:
test_pm_dateTime


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 455 of file pm_dateTime.F90.

◆ ORIGIN

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.

See also
dateTimeInt_type


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 347 of file pm_dateTime.F90.

◆ SECONDS_PER_DAY

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.

See also
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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 540 of file pm_dateTime.F90.

Referenced by pm_timer::getTimeDAT().

◆ timeZone

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().

See also
getZoneAbbr
timeZone_type


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX

Definition at line 1184 of file pm_dateTime.F90.

◆ WEEKDAY_NAME

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.

Warning
Note that the order and index of this array is not ISO 8601 compliant where the first day of the week is Monday.
To get the ISO 8601 compliant weekday names, see WEEKDAY_NAME_ISO
Note
To generate a three-letters name of day abbreviations, simply slice the day name (1:3).
See examples below for usage.
See also
getWeekDay
getWeekDayISO
WEEKDAY_NAME_ISO


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
6
7 implicit none
8
9 integer :: i
10 type(display_type) :: disp
11 disp = display_type(file = "main.out.F90")
12
13 call disp%skip()
14 call disp%show("WEEKDAY_NAME")
15 call disp%show( WEEKDAY_NAME , deliml = SK_"""" )
16 call disp%skip()
17
18 call disp%skip()
19 call disp%show("getWeekDay()")
20 call disp%show( getWeekDay() )
21 call disp%show("trim(WEEKDAY_NAME(getWeekDay())) ! current day of week.")
22 call disp%show( trim(WEEKDAY_NAME(getWeekDay())) , deliml = SK_"""" )
23 call disp%skip()
24
25 call disp%skip()
26 call disp%show("getWeekDay()")
27 call disp%show( getWeekDay() )
28 call disp%show("WEEKDAY_NAME(getWeekDay())(1:3)")
29 call disp%show( WEEKDAY_NAME(getWeekDay())(1:3) , deliml = SK_"""" )
30 call disp%skip()
31
32 call disp%skip()
33 call disp%show("[( WEEKDAY_NAME(i)(1:3), i = 0, 6 )]")
34 call disp%show( [( WEEKDAY_NAME(i)(1:3), i = 0, 6 )] , deliml = SK_"""" )
35 call disp%skip()
36
37end program example
Generate and return the day number of the week of a Gregorian Calendar date, assuming Sunday is the z...
character(9, SK), dimension(0:6), parameter WEEKDAY_NAME
The character constant vector of shape (0:6) of length type parameter 9 containing the names of the d...

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3"Sunday ", "Monday ", "Tuesday ", "Wednesday", "Thursday ", "Friday ", "Saturday "
4
5
7+0
8trim(WEEKDAY_NAME(getWeekDay())) ! current day of week.
9"Sunday"
10
11
13+0
15"Sun"
16
17
18[( WEEKDAY_NAME(i)(1:3), i = 0, 6 )]
19"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
20
21


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 382 of file pm_dateTime.F90.

◆ WEEKDAY_NAME_ISO

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.

Note
To generate a three-letters name of day abbreviations, simply slice the day name (1:3).
See examples below for usage.
See also
getWeekDay
getWeekDayISO
WEEKDAY_NAME


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
6
7 implicit none
8
9 integer :: i
10 type(display_type) :: disp
11 disp = display_type(file = "main.out.F90")
12
13 call disp%skip()
14 call disp%show("WEEKDAY_NAME_ISO")
15 call disp%show( WEEKDAY_NAME_ISO , deliml = SK_"""" )
16 call disp%skip()
17
18 call disp%skip()
19 call disp%show("getWeekDayISO()")
20 call disp%show( getWeekDayISO() )
21 call disp%show("trim(WEEKDAY_NAME_ISO(getWeekDayISO())) ! current day of week.")
22 call disp%show( trim(WEEKDAY_NAME_ISO(getWeekDayISO())) , deliml = SK_"""" )
23 call disp%skip()
24
25 call disp%skip()
26 call disp%show("getWeekDayISO()")
27 call disp%show( getWeekDayISO() )
28 call disp%show("WEEKDAY_NAME_ISO(getWeekDayISO())(1:3)")
29 call disp%show( WEEKDAY_NAME_ISO(getWeekDayISO())(1:3) , deliml = SK_"""" )
30 call disp%skip()
31
32 call disp%skip()
33 call disp%show("[( WEEKDAY_NAME_ISO(i)(1:3), i = 1, 7 )]")
34 call disp%show( [( WEEKDAY_NAME_ISO(i)(1:3), i = 1, 7 )] , deliml = SK_"""" )
35 call disp%skip()
36
37end program example
Generate and return the day number of the week of a Gregorian Calendar date, assuming Monday is the f...
character(9, SK), dimension(1:7), parameter WEEKDAY_NAME_ISO
The character constant vector of size 7 of length type parameter 9 containing the names of the days o...

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
3"Monday ", "Tuesday ", "Wednesday", "Thursday ", "Friday ", "Saturday ", "Sunday "
4
5
7+7
8trim(WEEKDAY_NAME_ISO(getWeekDayISO())) ! current day of week.
9"Sunday"
10
11
13+7
15"Sun"
16
17
18[( WEEKDAY_NAME_ISO(i)(1:3), i = 1, 7 )]
19"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"
20
21


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.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

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.

Author:
Amir Shahmoradi, March 22, 2012, 00:00 AM, National Institute for Fusion Studies, The University of Texas Austin

Definition at line 421 of file pm_dateTime.F90.

◆ ZONE_MAX

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.

◆ ZONE_MIN

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.