The CDF_EPOCH procedure computes or breaks down CDF_EPOCH values in a CDF file. When computing an epoch, any missing value is considered to be zero.

If you supply a value for the Epoch argument and set the BREAKDOWN_EPOCH keyword, CDF_EPOCH will compute the values of the Year, Month, Day, etc. and insert the values into the named variables you supply. If you specify the Year (and optionally, the Month, Day, etc.) and set the COMPUTE_EPOCH keyword, CDF_EPOCH will compute the epoch and place the value in the named variable supplied as the Epoch parameter.

Note: You must set either the BREAKDOWN_EPOCH or COMPUTE_EPOCH keyword.

Examples


To compute the epoch value of September 20, 1992 at 3:00 am:

CDF_EPOCH, MergeDate, 1992, 9, 20, 3, /COMPUTE_EPOCH

To break down the given epoch value into standard date components:

CDF_EPOCH, 4.7107656e13, yr, mo, dy, hr, mn, sc, milli, /BREAK

Syntax


CDF_EPOCH, Epoch, Year [, Month, Day, Hour, Minute, Second, Milli] [, /BREAKDOWN_EPOCH] [, /COMPUTE_EPOCH]

Arguments


Epoch

The Epoch value to be broken down, or a named variable that will contain the computed epoch will be placed. The Epoch value is the number of milliseconds since 01-Jan-0000 00:00:00.000

Note: “Year zero” is a convention chosen by NSSDC to measure epoch values. This date is more commonly referred to as 1 BC. Remember that 1 BC was a leap year. The Epoch is defined as the number of milliseconds since 01-Jan-0000 00:00:00.000, as computed using the CDF library’s internal date routines. The CDF date/time calculations do not take into account the changes to the Gregorian calendar, and cannot be directly converted into Julian date/times. To convert between CDF epochs and date/times, use the CDF_EPOCH routine with either the BREAKDOWN_EPOCH or CONVERT_EPOCH keywords.

Year

If COMPUTE_EPOCH is set, a four-digit integer representing the year.

If BREAKDOWN_EPOCH is set, a named variable that will contain the year.

Month

If COMPUTE_EPOCH is set, an integer between 1 and 12 representing the month. Alternately, you can set Month equal to zero, in which case the Day argument can take on any value between 1-366.

If BREAKDOWN_EPOCH is set, a named variable that will contain the numeric month value.

Day

If COMPUTE_EPOCH is set, an integer between 1 and 31 representing the day of the month. Alternately, if the Month argument is set equal to zero, Day can be an integer between 1-366 representing the day of the year.

If BREAKDOWN_EPOCH is set, a named variable that will contain the numeric day of the month value.

Hour

If COMPUTE_EPOCH is set, an integer between 0 and 23 representing the hour of the day.

If BREAKDOWN_EPOCH is set, a named variable that will contain the numeric hour of the day value.

Minute

If COMPUTE_EPOCH is set, an integer between 0 and 59 representing the minute of the hour.

If BREAKDOWN_EPOCH is set, a named variable that will contain the numeric minute of the hour value.

Second

If COMPUTE_EPOCH is set, an integer between 0 and 59 representing the second of the minute.

If BREAKDOWN_EPOCH is set, a named variable that will contain the numeric second of the minute value.

Milli

If COMPUTE_EPOCH is set, an integer between 0 and 999 representing the millisecond. Alternately, if the Hour, Minute, and Second arguments are set all equal to zero, Milli can be an integer between 0-86400000 representing the millisecond of the day.

If BREAKDOWN_EPOCH is set, a named variable that will contain the numeric millisecond value.

Keywords


BREAKDOWN_EPOCH

Set this keyword to break down the value of the Epoch argument into its component parts, storing the resulting year, month, day, etc. values in the variables specified by the corresponding arguments.

COMPUTE_EPOCH

Set this keyword to compute the value of Epoch from the values specified by the Year, Month, Day, etc. arguments.

Version History


Pre 4.0

Introduced