| iso2utc |
|
Table of contents
Procedure
ISO2UTC ( Convert ISO time strings to UTC strings. )
SUBROUTINE ISO2UTC ( TSTRNG, UTCSTR, ERROR )
Abstract
Deprecated: This routine is deprecated because all high-level
time conversion routines (STR2ET, UTC2ET, TPARSE) were updated
to accept ISO formatted times on input. This routine is
supported for purposes of backward compatibility only.
Convert date-time strings represented in the format adopted by the
International Standards Organization (ISO) to equivalent UTC time
strings recognized by the SPICELIB routine TPARSE.
Required_Reading
TIME
Keywords
TIME
Declarations
IMPLICIT NONE
CHARACTER*(*) TSTRNG
CHARACTER*(*) UTCSTR
CHARACTER*(*) ERROR
Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
TSTRNG I String representing a calendar or julian date epoch
UTCSTR O SPICELIB UTC string corresponding to TSTRNG
ERROR O Error message if something went wrong.
Detailed_Input
TSTRNG is an input time string, containing a time string
in ISO format. This routine is not sensitive to
the case of the characters that make up TSTRNG.
Thus 1992-192t12:29:28 and 1992-192T12:29:28
are equivalent.
The ISO standard time formats are:
Year Month Day yyyy-mm-ddThh:mm:ss[.sss...]
yyyy-mm-dd
Day of Year yyyy-dddThh:mm:ss[.sss...]
yyyy-ddd
The letters y,m,d,h,m,s can stand for any digit.
All digits are required in these formats. Moreover
the year portion of these strings must be between
1000 and 2999 inclusive.
The length of TSTRNG should not exceed 80 characters.
We point out that the format yyyy-ddd may be
interpreted very differently by routine UTC2ET.
1992-003 is interpreted by UTC2ET as March 1, 1992
whereas it is interpret as January 3, 1992 by ISO2ET.
User's should be aware of these differences in
interpretation and exercise adequate care in their
programs to avoid this possible confusion.
Detailed_Output
UTCSTR is the equivalent of TSTRNG, expressed in a UTC
time string that can be parsed by the SPICELIB
routine TPARSE.
Parameters
None.
Exceptions
1) If the string is interpreted as an ISO format string and
the year portion is not within the range [1000, 2999], the
error SPICE(YEAROUTOFBOUNDS) is signaled. UTCSTR is
not changed.
2) If the string does not clearly match the ISO format,
the error SPICE(NOTISOFORMAT) is signaled. UTCSTR is not
changed.
Files
None.
Particulars
The input string is converted to a UTC time string as defined
by the SPICELIB routine TPARSE.
Examples
To convert the time string 1992-04-03T14:12:28 to the
corresponding ephemeris time, execute the following instructions:
TSTRNG = '1992-04-03T14:12:28'
CALL ISO2UTC ( TSTRNG, UTCSTR, ERROR )
CALL TPARSE ( UTCSTR, UTCSEC, ERROR )
CALL DELTET ( UTCSEC, 'UTC', DELTA )
ET = DELTA + UTCSEC
Restrictions
None.
Literature_References
[1] J. Jespersen and J. Fitz-Randolph, "From Sundials to Atomic
Clocks, Understanding Time and Frequency," Dover
Publications, Inc. New York, 1877.
Author_and_Institution
J. Diaz del Rio (ODC Space)
K.R. Gehringer (JPL)
J.M. Lynch (JPL)
B.V. Semenov (JPL)
E.D. Wright (JPL)
Version
SPICELIB Version 1.2.0, 23-DEC-2021 (JDR)
Added IMPLICIT NONE statement.
Edited the header to comply with NAIF standard. Remove obsolete
reference to NAIF document 268 from $Literature_References.
SPICELIB Version 1.1.2, 28-FEB-2008 (BVS)
Corrected the contents of the $Required_Reading section.
SPICELIB Version 1.1.1, 19-SEP-2006 (EDW)
Added text to previously empty $Restrictions section.
SPICELIB Version 1.0.0, 11-JUL-1995 (KRG) (JML)
Based on
EKLIB Version 1.1.0, 11-JUL-1995 (KRG)
Fixed a typo in the $Detailed_Output section of the header.
The output variable was listed as ET when it should have
been UTCSTR.
Changed the length of ASCII to be 100 rather than 128. This
removes possible compiler warning messages for truncating
character variables on assignments. The maximum nonblank
length for an input time ISO string is 80 characters, so
placing it into a temporary array of 100 characters should
pose no difficulties.
EKLIB Version 1.0.0, 25-FEB-1993 (JML)
|
Fri Dec 31 18:36:28 2021