libSUFR
a LIBrary of Some Useful Fortran Routines
All Classes Namespaces Files Functions Variables Pages
date_and_time.f90 File Reference

(libSUFR version 0.7.8, revision 407, hash 01069b8, 2025-03-02)

Procedures to manipulate date and time. More...

Go to the source code of this file.

Modules

module  sufr_date_and_time
 Procedures for manipulation of date and time.
 

Functions/Subroutines

elemental real(double) function sufr_date_and_time::cal2jd (yy, mm, dd)
 Convert a calendar date to JD. Input and output in UT.
 
elemental subroutine sufr_date_and_time::jd2cal (jd, yy, mm, dd)
 Convert a Julian day to a calendar date (fractional day) - in UT.
 
elemental real(double) function sufr_date_and_time::year2jd (year)
 Convert a year (with decimals) to a JD. Input and output in UT.
 
elemental subroutine sufr_date_and_time::jd2ymdhms (jd, yy, mm, d, h, m, s)
 Convert a Julian day to date and time (h,m,s, UT)
 
elemental character function, dimension(15) sufr_date_and_time::jd2datestr (jd)
 Convert a Julian day to a date string (yyyy-mm-dd)
 
elemental real(double) function sufr_date_and_time::jd2time (jd)
 Convert a Julian day to time (UT, h)
 
elemental real(double) function sufr_date_and_time::jd2year (jd)
 Convert a Julian day to decimal year (e.g. 2000.0)
 
elemental subroutine sufr_date_and_time::jd2datetime (jd, year, month, day, time)
 Convert a Julian day to a date (y,m,d) and time (UT, h)
 
elemental real(double) function sufr_date_and_time::ymdhms2jd (yy, mmo, dd, h, m, s)
 Convert date and time (y,m,d, h,m,s) to JD. Input and output in UT.
 
elemental subroutine sufr_date_and_time::consistent_date_time (year, month, day, hour, minute, second)
 Ensure date and time are consistent after manipulation (0<month<13, 0<=minute<60, etc.)
 
elemental real(double) function sufr_date_and_time::dtm2jd (yy, mo, dd, time)
 Convert date and time (h) to a Julian day - input in UT.
 
elemental subroutine sufr_date_and_time::tm2hm (tm, h, m)
 Convert time (h) to hours and (integer) minutes.
 
elemental subroutine sufr_date_and_time::tm2hmm (tm, h, m)
 Convert time (h) to hours and (decimal) minutes.
 
elemental subroutine sufr_date_and_time::tm2hms (tm, h, m, s)
 Convert time (h) to hours, minutes and (integer) seconds.
 
elemental subroutine sufr_date_and_time::tm2hmss (tm, h, m, s)
 Convert time (h) to hours, minutes and (decimal) seconds.
 
elemental integer function sufr_date_and_time::dow_ut (jd0)
 Calculates day of week (0 = Sunday, ..., 6 = Saturday). Output for timezone of input - call dow_ut(jd+tz/24.d0) for local time.
 
elemental integer function sufr_date_and_time::dow_iso (jd0)
 Calculates ISO day of week (1 = Monday, ..., 7 = Sunday). Output for timezone of input - call dow_ut(jd+tz/24.d0) for local time.
 
elemental integer function sufr_date_and_time::doy (jd0)
 Calculate day of year (1-366) from JD.
 
elemental integer function sufr_date_and_time::ymd2doy (yr, mon, dy)
 Calculate day of year (1-366) from year,month,day.
 
elemental subroutine sufr_date_and_time::doy2md (doy, yr, mon, dy)
 Calculate month and day from day of year and year.
 
elemental integer function sufr_date_and_time::leapyr (yr)
 Calculate whether year is leap (1) or not (0). The number of days in February is then given by 28 + leapyr(yr) and number of days in a year by 365 + leapyr(yr)
 
elemental character function, dimension(30) sufr_date_and_time::jd2iso8601 (jd, tz)
 Return JD as date and time in ISO_8601 format (e.g. 2014-03-24T20:48:01+00:00)
 
elemental character function, dimension(35) sufr_date_and_time::jd2rfc822 (jd, tz)
 Return JD as date and time in RFC-822 format (e.g. Sat, 07 Sep 2002 23:12:01 +0100)
 
real(double) function sufr_date_and_time::jd2gps (jd)
 Convert a Julian day (UT) to a GPS time (seconds since 1980-01-06 - 2000-01-01 = 630720013.0)
 
real(double) function sufr_date_and_time::gps2jd (gpstime)
 Convert a GPS time to Julian day (UT)
 
elemental real(double) function sufr_date_and_time::jd2unix (jd)
 Convert a Julian day (UT) to Unix time (seconds since 1970-01-01)
 
elemental real(double) function sufr_date_and_time::unix2jd (unixtime)
 Convert UNIX time stamp to Julian day.
 
subroutine sufr_date_and_time::system_clock_2_ymdhms (year, month, day, hour, minute, second, ms, tz)
 Return system-clock date and time in (year, month, ..., minute, second and tz)
 

Detailed Description

Procedures to manipulate date and time.

Definition in file date_and_time.f90.