The CDF_ENCODE_EPOCH function encodes a CDF_EPOCH variable into a string. Four different string formats are available. The default (EPOCH=0) is the standard CDF format, which may be parsed by the CDF_PARSED_EPOCH function or broken down with the CDF_EPOCH procedure.
Set this keyword to indicate the type of output desired,
Set EPOCH=0 to select output of the standard type, which is described in CDF_PARSE_EPOCH.
Set EPOCH=1 to select output of the type
yyyymodd.ttttttt
where:
yyyy
is the year,
mo
is the month (1-12),
dd
is the day of the month (1-31), and
ttttttt
is the fraction of the day (e.g. 2500000 at 6 am).
Set EPOCH=2 to select output of the type
yyyymoddhhmmss
where:
yyyy
is the year,
mo
is the month (1-12),
dd
is the day of the month (1-31),
hh
is the hour (0-23),
mm
is the minute (0-59), and
ss
is the second (0-59).
Set EPOCH=3 to select output of the type
yyyy-mo-ddThh:mm:ss.cccZ
where:
yyyy
is the year,
mo
is the month (1-12),
dd
is the day of the month (1-31),
hh
is the hour (0-23),
mm
is the minute (0-59),
ss
is the second (0-59), and
ccc
is the millisecond (0-999). The characters
T
and
Z
are the CDF_EPOCH type 3 place holders.
epoch_string = '04-Dec-1995 20:19:18.176'
epoch = CDF_PARSE_EPOCH(epoch_string)
EPOCH_STRING STRING = '04-Dec-1995 20:19:18.176'
encode0 = CDF_ENCODE_EPOCH(test_epoch, EPOCH=0)
encode1 = CDF_ENCODE_EPOCH(test_epoch, EPOCH=1)
encode2 = CDF_ENCODE_EPOCH(test_epoch, EPOCH=2)
encode3 = CDF_ENCODE_EPOCH(test_epoch, EPOCH=3)
HELP, encode0, encode1, encode2, encode3
ENCODE0 STRING = '04-Dec-1995 20:19:18.176'
ENCODE1 STRING = '19951204.8467381'