GetDateInt4
— Returns a new date/time from an initial date/time and offset
This subroutine returns a new date and time in yyyymmdd and hhmmss format given and initial date, time, and offset in seconds. The routine converts the input date and time to julian seconds, adds the offset, and converts back to yyyymmdd and hhmmss format. This routine has been tested for Y2K compiance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | yyyymmdd_1 |
Initial date in YYYYYMMDD format |
|||
integer | :: | hhmmss_1 |
Initial time in HHMMSS format |
|||
integer | :: | offset |
Offset to add (in seconds) |
|||
integer | :: | yyyymmdd_2 |
New date in YYYYMMDD format |
|||
integer | :: | hhmmss_2 |
New time in HHMMSS format |
|||
integer | :: | rc |
Return code. (<0 = error) |
subroutine GetDateInt4 (yyyymmdd_1,hhmmss_1,offset, & yyyymmdd_2,hhmmss_2,rc) implicit none ! ! !INPUT PARAMETERS: ! integer yyyymmdd_1 !! Initial date in YYYYYMMDD format integer hhmmss_1 !! Initial time in HHMMSS format integer offset !! Offset to add (in seconds) ! ! !OUTPUT PARAMETERS: ! integer yyyymmdd_2 !! New date in YYYYMMDD format integer hhmmss_2 !! New time in HHMMSS format integer rc !! Return code. (<0 = error) ! !------------------------------------------------------------------------- integer(Kind=INT64) offsetLong offsetLong = INT(offset,Kind=INT64) call GetDateInt8(yyyymmdd_1,hhmmss_1,offsetLong,yyyymmdd_2,hhmmss_2,rc) return end subroutine GetDateInt4