julian_to_date(3f) - [M_time:JULIAN] converts a JED(Julian Ephemeris Date) to a DAT date-time array. (LICENSE:MIT)
Synopsis
Description
Options
Returns
Example
Author
License
subroutine julian_to_date(julian,dat,ierr)
real(kind=realtime),intent(in) :: julian integer,intent(out) :: dat(8) integer,intent(out) :: ierr
Converts a Unix Epoch Time (UET) value to a DAT date-time array. UET is the number of seconds since 00:00 on January 1st, 1970, UTC.
julian Julian Date (days) dat Integer array holding a "DAT" array, similar in structure to the array returned by the intrinsic DATE_AND_TIME(3f): dat=[ year,month,day,timezone,hour,& & minutes,seconds,milliseconds]
unixtime The "Unix Epoch" time, or the number of seconds since 00:00:00 on January 1st, 1970, UTC. ierr Error code. If 0 no error occurred.
Sample program:
program demo_julian_to_date use M_time, only : julian_to_date, fmtdate, realtime implicit none integer,parameter :: dp=kind(0.0d0) real(kind=realtime) :: juliandate integer :: dat(8) integer :: ierr ! set sample Julian Date juliandate=2457589.129_dp ! create DAT array for this date call julian_to_date(juliandate,dat,ierr) write(*,*)Sample Date=,fmtdate(dat) ! go back one day call julian_to_date(juliandate-1.0_dp,dat,ierr) write(*,*)Day Before =,fmtdate(dat) ! go forward one day call julian_to_date(juliandate+1.0_dp,dat,ierr) write(*,*)Day After =,fmtdate(dat) end program demo_julian_to_dateResults:
Sample Date=Tuesday, July 19th, 2016 11:05:45 AM UTC-04:00 Day Before =Monday, July 18th, 2016 11:05:45 AM UTC-04:00 Day After =Wednesday, July 20th, 2016 11:05:45 AM UTC-04:00
John S. Urban, 2015
Nemo Release 3.1 | julian_to_date (3m_time) | August 31, 2024 |