ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
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...
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.
The algrithm of this generic interface is valid for any Gregorian date, even proleptic Gregorian dates including those for negative years. The Julian Day Number, Julian Day, or JD of a particular instant of time is the number of days and fractions of a day since 12
hours Universal Time (Greenwich mean noon) on January 1 of the year -4712
, where the year is given in the Julian proleptic calendar. The idea of using this reference date was originally proposed by Joseph Scalizer in 1582 to count years but it was modified by 19th century astronomers to count days.
Julian days are Julian Day Numbers and are not to be confused with Julian dates.
The Julian Day Number (JDN) is expressed as an integer and it represents the number of whole days since the reference instant to noon of that day. For example,
Gregorian Date | Time of Day | JD |
---|---|---|
November 24, -4713 | start of the day (just after midnight) | -0.5 |
November 24, -4713 | noon (start of JD in Gregorian Calendar) | 0.0 |
November 25, -4713 | start of the day (just after midnight) | +0.5 |
January 1, -1 | start of day | 1720694.5 |
October 15, 1582 | start of day (first day of Gregorian reform) | 2299160.5 |
January 1, 1901 | start of day (start of the 20th century) | 2415385.5 |
January 1, 1970 | start of day (Unix reference date) | 2440587.5 |
December 31, 1979 | noon | 2444239.0 |
January 1, 1980 | start of the day (just after midnight) | 2444239.5 |
January 1, 1980 | noon (Microsoft DOS reference date) | 2444240.0 |
January 1, 1980 | midnight commencing January 2 | 2444240.5 |
A Julian date is a date in the Julian calendar, similar to a Gregorian date in the Gregorian calendar.
Note that the Julian Day corresponding to a Julian Date does not have the same value as the JD corresponding to the same date in the Gregorian Calendar.
[in] | year | : The input scalar of type integer of default kind IK, containing the year of the Gregorian calendar.(optional, default = the current value if all input arguments are missing. It can be present only if values is missing.) |
[in] | month | : The input scalar of type integer of default kind IK, containing the month of the year of the Gregorian calendar.(optional, default = 1 (or the current value if all input arguments are missing). It can be present only if year is present.) |
[in] | day | : The input scalar of type integer of default kind IK, containing the day of the month of the year of the Gregorian calendar.(optional, default = 1 . (or the current value if all input arguments are missing). It can be present only if month is present.) |
[in] | zone | : The input scalar of type integer of default kind IK, containing the time zone of the Gregorian calendar in minutes.(optional, default = 0 (UTC) (or the current value if all input arguments are missing). It can be present only if day is present.) |
[in] | hour | : The input scalar of type integer of default kind IK, containing the hour of the day of the Gregorian calendar.(optional, default = 0 (or the current value if all input arguments are missing). It can be present only if zone is present.) |
[in] | minute | : The input scalar of type integer of default kind IK, containing the minute of the hour of the day of the Gregorian calendar.(optional, default = 0 (or the current value if all input arguments are missing). It can be present only if hour is present.) |
[in] | second | : The input scalar of type integer of default kind IK, containing the second of the minute of the hour of the day of the Gregorian calendar.(optional, default = 0 (or the current value if all input arguments are missing). It can be present only if minute is present.) |
[in] | millisecond | : The input scalar of type integer of default kind IK, containing the millisecond of the second of the minute of the hour of the day of the Gregorian calendar.(optional, default = 0 (or the current value if all input arguments are missing). It can be present only if second is present.) |
[in] | values | : The input contiguous vector of maximum size 8 of type integer of default kind IK, containing the values [year, month, day, zone, hour, minute, seconds, milliseconds] of the Gregorian calendar or a subset of the octuple starting with year .The order of the elements of the vector follows that of the values returned by the Fortran intrinsic date_and_time() .(optional, default = the current date and time. It can be present only if all other arguments are missing.) |
julianDay
: The output scalar or array of the same shape as the input array-like arguments (except values
), of type real
of default kind RK, representing the Julian Date equivalent (in units of days, possibly fractional) of the specified Gregorian Calendar date.
Possible calling interfaces ⛓
0 < size(values) < 9
must hold.[year, month, day, zone, hour, minute, second, millisecond]
must be valid and consistent with each other.month
must be a number between 1
and 12
and day
must be between 1
and 31
.CHECK_ENABLED=1
.pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.pure
in release
build and impure
in debug
and testing
builds.impure
when no input argument is present.elemental
.values(:)
is present.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 1471 of file pm_dateTime.F90.