public class Epoch extends java.lang.Object implements CDFConstants
// Get the milliseconds to Aug 5, 1990 at 5:00 double ep = Epoch.compute(1990, 8, 5, 5, 0, 0, 0); //Get the year, month, day, hour, minutes, seconds, milliseconds for ep long[] times = Epoch.breakdown(ep); for (int i=0;i<times.length;i++) System.out.print(times[i]+" "); System.out.println(); // Printout the epoch in various formats System.out.println(Epoch.encode(ep)); System.out.println(Epoch.encode1(ep)); System.out.println(Epoch.encode2(ep)); System.out.println(Epoch.encode3(ep)); System.out.println(Epoch.encode4(ep)); // Print out the date using format String format = "<month> <dom.02>, <year> at <hour>:<min>"; System.out.println(Epoch.encodex(ep,format));
AHUFF_COMPRESSION, ALPHAOSF1_DECODING, ALPHAOSF1_ENCODING, ALPHAVMSd_DECODING, ALPHAVMSd_ENCODING, ALPHAVMSg_DECODING, ALPHAVMSg_ENCODING, ALPHAVMSi_DECODING, ALPHAVMSi_ENCODING, ARM_BIG_DECODING, ARM_BIG_ENCODING, ARM_LITTLE_DECODING, ARM_LITTLE_ENCODING, ATTR_, ATTR_EXISTENCE_, ATTR_EXISTS, ATTR_MAXgENTRY_, ATTR_MAXrENTRY_, ATTR_MAXzENTRY_, ATTR_NAME_, ATTR_NAME_TRUNC, ATTR_NUMBER_, ATTR_NUMgENTRIES_, ATTR_NUMrENTRIES_, ATTR_NUMzENTRIES_, ATTR_SCOPE_, BACKWARD_, BACKWARDFILEoff, BACKWARDFILEon, BAD_ALLOCATE_RECS, BAD_ARGUMENT, BAD_ATTR_NAME, BAD_ATTR_NUM, BAD_BLOCKING_FACTOR, BAD_CACHE_SIZE, BAD_CDF_EXTENSION, BAD_CDF_ID, BAD_CDF_NAME, BAD_CDFSTATUS, BAD_CHECKSUM, BAD_COMPRESSION_PARM, BAD_DATA_TYPE, BAD_DECODING, BAD_DIM_COUNT, BAD_DIM_INDEX, BAD_DIM_INTERVAL, BAD_DIM_SIZE, BAD_ENCODING, BAD_ENTRY_NUM, BAD_FNC_OR_ITEM, BAD_FORMAT, BAD_INITIAL_RECS, BAD_MAJORITY, BAD_MALLOC, BAD_NEGtoPOSfp0_MODE, BAD_NUM_DIMS, BAD_NUM_ELEMS, BAD_NUM_STRINGS, BAD_NUM_VARS, BAD_READONLY_MODE, BAD_REC_COUNT, BAD_REC_INTERVAL, BAD_REC_NUM, BAD_SCOPE, BAD_SCRATCH_DIR, BAD_SPARSEARRAYS_PARM, BAD_VAR_NAME, BAD_VAR_NUM, BAD_zMODE, BADDATE_LEAPSECOND_UPDATED, BeginUnixTimeEPOCH, BeginUnixTimeEPOCH16, BLOCKINGFACTOR_TOO_SMALL, BLOCKINGFACTOR_TOO_SMALL2, CANNOT_ALLOCATE_RECORDS, CANNOT_CHANGE, CANNOT_COMPRESS, CANNOT_CONVERT_WIDECHAR, CANNOT_COPY, CANNOT_INSERT_RECORDS, CANNOT_SPARSEARRAYS, CANNOT_SPARSERECORDS, CDF_, CDF_ACCESS_, CDF_ATTR_NAME_LEN, CDF_ATTR_NAME_LEN256, CDF_BYTE, CDF_CACHESIZE_, CDF_CHAR, CDF_CHECKSUM_, CDF_CLOSE_ERROR, CDF_COMPRESSION_, CDF_COPYRIGHT_, CDF_COPYRIGHT_LEN, CDF_CREATE_ERROR, CDF_DECODING_, CDF_DELETE_ERROR, CDF_DOUBLE, CDF_ENCODING_, CDF_EPOCH, CDF_EPOCH16, CDF_EXISTS, CDF_FLOAT, CDF_FORMAT_, CDF_INCREMENT_, CDF_INFO_, CDF_INT1, CDF_INT2, CDF_INT4, CDF_INT8, CDF_INTERNAL_ERROR, CDF_LEAPSECONDLASTUPDATED_, CDF_MAJORITY_, CDF_MAX_DIMS, CDF_MAX_PARMS, CDF_MIN_DIMS, CDF_NAME_, CDF_NAME_TRUNC, CDF_NEGtoPOSfp0_MODE_, CDF_NUMATTRS_, CDF_NUMgATTRS_, CDF_NUMrVARS_, CDF_NUMvATTRS_, CDF_NUMzVARS_, CDF_OK, CDF_OPEN_ERROR, CDF_PATHNAME_LEN, CDF_READ_ERROR, CDF_READONLY_MODE_, CDF_REAL4, CDF_REAL8, CDF_RELEASE_, CDF_SAVE_ERROR, CDF_SCRATCHDIR_, CDF_STATUS_, CDF_STATUSTEXT_LEN, CDF_TIME_TT2000, CDF_UCHAR, CDF_UINT1, CDF_UINT2, CDF_UINT4, CDF_VAR_NAME_LEN, CDF_VAR_NAME_LEN256, CDF_VERSION_, CDF_WARN, CDF_WRITE_ERROR, CDF_zMODE_, CDFwithSTATS_, CHECKSUM_, CHECKSUM_ERROR, CHECKSUM_NOT_ALLOWED, CLOSE_, COLUMN_MAJOR, COMPRESS_CACHESIZE_, COMPRESSION_ERROR, CONFIRM_, CORRUPTED_V2_CDF, CORRUPTED_V3_CDF, CREATE_, CURgENTRY_EXISTENCE_, CURrENTRY_EXISTENCE_, CURzENTRY_EXISTENCE_, DATATYPE_MISMATCH, DATATYPE_SIZE_, DECOMPRESSION_ERROR, DECSTATION_DECODING, DECSTATION_ENCODING, DEFAULT_BYTE_PADVALUE, DEFAULT_CHAR_PADVALUE, DEFAULT_DOUBLE_PADVALUE, DEFAULT_EPOCH_PADVALUE, DEFAULT_EPOCH16_PADVALUE, DEFAULT_FLOAT_PADVALUE, DEFAULT_INT1_PADVALUE, DEFAULT_INT2_PADVALUE, DEFAULT_INT4_PADVALUE, DEFAULT_INT8_PADVALUE, DEFAULT_REAL4_PADVALUE, DEFAULT_REAL8_PADVALUE, DEFAULT_TT2000_PADVALUE, DEFAULT_UCHAR_PADVALUE, DEFAULT_UINT1_PADVALUE, DEFAULT_UINT2_PADVALUE, DEFAULT_UINT4_PADVALUE, DELETE_, DID_NOT_COMPRESS, EMPTY_COMPRESSED_CDF, END_OF_VAR, EPOCH_STRING_LEN, EPOCH_STRING_LEN_EXTEND, EPOCH1_STRING_LEN, EPOCH1_STRING_LEN_EXTEND, EPOCH2_STRING_LEN, EPOCH2_STRING_LEN_EXTEND, EPOCH3_STRING_LEN, EPOCH3_STRING_LEN_EXTEND, EPOCH4_STRING_LEN, EPOCH4_STRING_LEN_EXTEND, EPOCHx_FORMAT_MAX, EPOCHx_STRING_MAX, FILLED_TT2000_VALUE, FORCED_PARAMETER, FUNCTION_NOT_SUPPORTED, gENTRY_, gENTRY_DATA_, gENTRY_DATASPEC_, gENTRY_DATATYPE_, gENTRY_EXISTENCE_, gENTRY_NUMELEMS_, GET_, GETCDFCHECKSUM_, GETCDFFILEBACKWARD_, GETCDFVALIDATE_, GETLEAPSECONDSENVVAR_, GLOBAL_SCOPE, GZIP_COMPRESSION, HOST_DECODING, HOST_ENCODING, HP_DECODING, HP_ENCODING, HUFF_COMPRESSION, IA64VMSd_DECODING, IA64VMSd_ENCODING, IA64VMSg_DECODING, IA64VMSg_ENCODING, IA64VMSi_DECODING, IA64VMSi_ENCODING, IBM_PC_OVERFLOW, IBMPC_DECODING, IBMPC_ENCODING, IBMRS_DECODING, IBMRS_ENCODING, ILLEGAL_EPOCH_FIELD, ILLEGAL_EPOCH_VALUE, ILLEGAL_FOR_SCOPE, ILLEGAL_IN_zMODE, ILLEGAL_ON_V1_CDF, ILLEGAL_TT2000_VALUE, IS_A_NETCDF, LIB_COPYRIGHT_, LIB_INCREMENT_, LIB_RELEASE_, LIB_subINCREMENT_, LIB_VERSION_, MAC_DECODING, MAC_ENCODING, MD5_CHECKSUM, MULTI_FILE, MULTI_FILE_FORMAT, NA_FOR_VARIABLE, NEGATIVE_FP_ZERO, NEGtoPOSfp0off, NEGtoPOSfp0on, NETWORK_DECODING, NETWORK_ENCODING, NeXT_DECODING, NeXT_ENCODING, NO_ATTR_SELECTED, NO_CDF_SELECTED, NO_CHECKSUM, NO_COMPRESSION, NO_DELETE_ACCESS, NO_ENTRY_SELECTED, NO_MORE_ACCESS, NO_PADVALUE_SPECIFIED, NO_SPARSEARRAYS, NO_SPARSERECORDS, NO_STATUS_SELECTED, NO_SUCH_ATTR, NO_SUCH_CDF, NO_SUCH_ENTRY, NO_SUCH_RECORD, NO_SUCH_VAR, NO_VAR_SELECTED, NO_VARS_IN_CDF, NO_WRITE_ACCESS, NONE_CHECKSUM, NOT_A_CDF, NOT_A_CDF_OR_NOT_SUPPORTED, NOVARY, NULL_, OPEN_, OPTIMAL_ENCODING_TREES, OTHER_CHECKSUM, PAD_SPARSERECORDS, PPC_DECODING, PPC_ENCODING, PRECEEDING_RECORDS_ALLOCATED, PREV_SPARSERECORDS, PUT_, READ_ONLY_DISTRIBUTION, READ_ONLY_MODE, READONLYoff, READONLYon, rENTRY_, rENTRY_DATA_, rENTRY_DATASPEC_, rENTRY_DATATYPE_, rENTRY_EXISTENCE_, rENTRY_NAME_, rENTRY_NUMELEMS_, rENTRY_NUMSTRINGS_, rENTRY_STRINGSDATA_, RLE_COMPRESSION, RLE_OF_ZEROs, ROW_MAJOR, rVAR_, rVAR_ALLOCATEBLOCK_, rVAR_ALLOCATEDFROM_, rVAR_ALLOCATEDTO_, rVAR_ALLOCATERECS_, rVAR_BLOCKINGFACTOR_, rVAR_CACHESIZE_, rVAR_COMPRESSION_, rVAR_DATA_, rVAR_DATASPEC_, rVAR_DATATYPE_, rVAR_DIMVARYS_, rVAR_EXISTENCE_, rVAR_HYPERDATA_, rVAR_INITIALRECS_, rVAR_MAXallocREC_, rVAR_MAXREC_, rVAR_NAME_, rVAR_nINDEXENTRIES_, rVAR_nINDEXLEVELS_, rVAR_nINDEXRECORDS_, rVAR_NUMallocRECS_, rVAR_NUMBER_, rVAR_NUMELEMS_, rVAR_NUMRECS_, rVAR_PADVALUE_, rVAR_RECORDS_, rVAR_RECORDS_RENUMBER_, rVAR_RECVARY_, rVAR_RESERVEPERCENT_, rVAR_SEQDATA_, rVAR_SEQPOS_, rVAR_SPARSEARRAYS_, rVAR_SPARSERECORDS_, rVARs_CACHESIZE_, rVARs_DIMCOUNTS_, rVARs_DIMINDICES_, rVARs_DIMINTERVALS_, rVARs_DIMSIZES_, rVARs_MAXREC_, rVARs_NUMDIMS_, rVARs_RECCOUNT_, rVARs_RECDATA_, rVARs_RECINTERVAL_, rVARs_RECNUMBER_, SAVE_, SCRATCH_CREATE_ERROR, SCRATCH_DELETE_ERROR, SCRATCH_READ_ERROR, SCRATCH_WRITE_ERROR, SELECT_, SGi_DECODING, SGi_ENCODING, SINGLE_FILE, SINGLE_FILE_FORMAT, SOME_ALREADY_ALLOCATED, STAGE_CACHESIZE_, STATUS_TEXT_, STRING_NOT_UTF8_ENCODING, STRINGDELIMITER, SUN_DECODING, SUN_ENCODING, TOO_MANY_PARMS, TOO_MANY_VARS, TRY_TO_READ_NONSTRING_DATA, TT2000_0_STRING_LEN, TT2000_1_STRING_LEN, TT2000_2_STRING_LEN, TT2000_3_STRING_LEN, TT2000_4_STRING_LEN, TT2000_CDF_MAYNEEDUPDATE, TT2000_TIME_ERROR, TT2000_USED_OUTDATED_TABLE, UNABLE_TO_PROCESS_CDF, UNKNOWN_COMPRESSION, UNKNOWN_SPARSENESS, UNSUPPORTED_OPERATION, VALIDATE_, VALIDATEFILEoff, VALIDATEFILEon, VAR_ALREADY_CLOSED, VAR_CLOSE_ERROR, VAR_CREATE_ERROR, VAR_DELETE_ERROR, VAR_EXISTS, VAR_NAME_TRUNC, VAR_OPEN_ERROR, VAR_READ_ERROR, VAR_SAVE_ERROR, VAR_WRITE_ERROR, VARIABLE_SCOPE, VARY, VAX_DECODING, VAX_ENCODING, VIRTUAL_RECORD_DATA, zENTRY_, zENTRY_DATA_, zENTRY_DATASPEC_, zENTRY_DATATYPE_, zENTRY_EXISTENCE_, zENTRY_NAME_, zENTRY_NUMELEMS_, zENTRY_NUMSTRINGS_, zENTRY_STRINGSDATA_, ZLIB_COMPRESS_ERROR, ZLIB_UNCOMPRESS_ERROR, zMODEoff, zMODEon1, zMODEon2, zVAR_, zVAR_ALLOCATEBLOCK_, zVAR_ALLOCATEDFROM_, zVAR_ALLOCATEDTO_, zVAR_ALLOCATERECS_, zVAR_BLOCKINGFACTOR_, zVAR_CACHESIZE_, zVAR_COMPRESSION_, zVAR_DATA_, zVAR_DATASPEC_, zVAR_DATATYPE_, zVAR_DIMCOUNTS_, zVAR_DIMINDICES_, zVAR_DIMINTERVALS_, zVAR_DIMSIZES_, zVAR_DIMVARYS_, zVAR_EXISTENCE_, zVAR_HYPERDATA_, zVAR_INITIALRECS_, zVAR_MAXallocREC_, zVAR_MAXREC_, zVAR_NAME_, zVAR_nINDEXENTRIES_, zVAR_nINDEXLEVELS_, zVAR_nINDEXRECORDS_, zVAR_NUMallocRECS_, zVAR_NUMBER_, zVAR_NUMDIMS_, zVAR_NUMELEMS_, zVAR_NUMRECS_, zVAR_PADVALUE_, zVAR_RECCOUNT_, zVAR_RECINTERVAL_, zVAR_RECNUMBER_, zVAR_RECORDS_, zVAR_RECORDS_RENUMBER_, zVAR_RECVARY_, zVAR_RESERVEPERCENT_, zVAR_SEQDATA_, zVAR_SEQPOS_, zVAR_SPARSEARRAYS_, zVAR_SPARSERECORDS_, zVARs_CACHESIZE_, zVARs_MAXREC_, zVARs_RECDATA_, zVARs_RECNUMBER_
Constructor and Description |
---|
Epoch() |
Modifier and Type | Method and Description |
---|---|
static long[] |
breakdown(double epoch)
Breaks an EPOCH value down into its component parts.
|
static long[][] |
breakdown(double[] epochs)
Breaks an array of EPOCH values down into its component parts.
|
static double[] |
compute(long[] year,
long[] month,
long[] day)
Computes an array of EPOCH values based on their component parts.
|
static double[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour)
Computes an array of EPOCH values based on their component parts.
|
static double[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute)
Computes an array of EPOCH values based on their component parts.
|
static double[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute,
long[] second)
Computes an array of EPOCH values based on their component parts.
|
static double[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute,
long[] second,
long[] msec)
Computes an array of EPOCH values based on their component parts.
|
static double |
compute(long year,
long month,
long day,
long hour,
long minute,
long second,
long msec)
Computes an EPOCH value based on its component parts.
|
static java.lang.String |
encode(double epoch)
Converts an EPOCH value into a readable date/time string.
|
static java.lang.String[] |
encode(double[] epochs)
Converts an array of EPOCH values into an array of readable date/time
strings.
|
static java.lang.String |
encode1(double epoch)
Converts an EPOCH value into a readable date/time string.
|
static java.lang.String[] |
encode1(double[] epochs)
Converts an array EPOCH values into readable date/time strings.
|
static java.lang.String |
encode2(double epoch)
Converts an EPOCH value into a readable date/time string.
|
static java.lang.String[] |
encode2(double[] epochs)
Converts an array of EPOCH values into readable date/time strings.
|
static java.lang.String |
encode3(double epoch)
Converts an EPOCH value into a readable date/time string.
|
static java.lang.String[] |
encode3(double[] epochs)
Converts an array of EPOCH values into readable date/time strings.
|
static java.lang.String |
encode4(double epoch)
Converts an EPOCH value into a readable date/time, ISO8601 string.
|
static java.lang.String[] |
encode4(double[] epochs)
Converts an array of EPOCH values into readable date/time, ISO8601
strings.
|
static java.lang.String |
encodex(double epoch,
java.lang.String formatString)
Converts an EPOCH value into a readable date/time string using the
specified format.
|
static double |
EpochtoUnixTime(double epoch)
Converts an EPOCH value to a unix time of a double value (seconds from
1970-01-01 00:00:00 UTC).
|
static double[] |
EpochtoUnixTime(double[] epoch)
Converts an array of EPOCH values to an array of unix time of a double
value (seconds from 1970-01-01 00:00:00 UTC).
|
static double |
parse(java.lang.String inString)
This function parses an input date/time string and returns an EPOCH
value.
|
static double[] |
parse(java.lang.String[] inStrings)
This function parses an array of date/time strings and returns an array
of EPOCH values.
|
static double |
parse1(java.lang.String inString)
This function parses an input date/time string and returns an EPOCH
value.
|
static double[] |
parse1(java.lang.String[] inStrings)
This function parses an array of date/time strings and returns an EPOCH
value array.
|
static double |
parse2(java.lang.String inString)
This function parses an input date/time string and returns an EPOCH
value.
|
static double[] |
parse2(java.lang.String[] inStrings)
This function parses an array of date/time strings and returns an EPOCH
value array.
|
static double |
parse3(java.lang.String inString)
This function parses an input date/time string and returns an EPOCH
value.
|
static double[] |
parse3(java.lang.String[] inStrings)
This function parses an array of date/time strings and returns an EPOCH
value array.
|
static double |
parse4(java.lang.String inString)
This function parses an input date/time string and returns an EPOCH
value.
|
static double[] |
parse4(java.lang.String[] inStrings)
This function parses an array of date/time strings and returns an EPOCH
value array.
|
static java.lang.String |
toEncode(double epoch)
Converts an EPOCH value into a readable date/time string.
|
static java.lang.String[] |
toEncode(double[] epochs)
Converts an array of EPOCH values into readable date/time strings.
|
static java.lang.String[] |
toEncode(double[] epochs,
int style)
Converts an array of EPOCH values into readable date/time strings.
|
static java.lang.String |
toEncode(double epoch,
int style)
Converts an EPOCH value into a readable date/time string.
|
static java.lang.Object |
toEncode(java.lang.Object epoch)
Converts an EPOCH object into a scalar or array(s) of readable
date/time string(s).
|
static double |
toParse(java.lang.String inString)
This function parses a date/time string and returns an EPOCH value.
|
static double[] |
toParse(java.lang.String[] inStrings)
This function parses an array of date/time strings and returns an array
of EPOCH values.
|
static double |
UnixTimetoEpoch(double unixTime)
Converts a Unix time value (seconds from 1970-01-01 00:00:00 UTC) to
an EPOCH time.
|
static double[] |
UnixTimetoEpoch(double[] unixTimes)
Converts an array of Unix time values (seconds from 1970-01-01
00:00:00 UTC) to an array of EPOCH times.
|
public static double[] toParse(java.lang.String[] inStrings) throws CDFException
Style 0 - Format: dd-mmm-yyyy hh:mm:ss.mmm Examples: 1-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999 Style 1 - Format: yyyymmdd.ttttttt Examples: 19900401.3658893 19931010.0000000 Style 2 - Format: yyyymmddhhmmss Examples: 19900401030502 19931010234549 Style 3 - Format: yyyy-mm-ddThh:mm:ss.mmmZ Examples: 1990-04-01T03:05:02.000Z 1993-10-10T23:45:49.999Z Style 4 - Format: yyyy-mm-ddThh:mm:ss.mmm Examples: 1990-04-01T03:05:02.000 1993-10-10T23:45:49.999
inStrings
- the epochs in string representationCDFException
- if a bad epoch value is passed in inStringspublic static double toParse(java.lang.String inString) throws CDFException
Style 0 - Format: dd-mmm-yyyy hh:mm:ss.mmm Examples: 1-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999 Style 1 - Format: yyyymmdd.ttttttt Examples: 19900401.3658893 19931010.0000000 Style 2 - Format: yyyymmddhhmmss Examples: 19900401030502 19931010234549 Style 3 - Format: yyyy-mm-ddThh:mm:ss.mmmZ Examples: 1990-04-01T03:05:02.000Z 1993-10-10T23:45:49.999Z Style 4 - Format: yyyy-mm-ddThh:mm:ss.mmm Examples: 1990-04-01T03:05:02.000 1993-10-10T23:45:49.999
inString
- the epoch in string representationCDFException
- if a bad epoch value is passed in inStringspublic static double parse(java.lang.String inString) throws CDFException
Format: dd-mmm-yyyy hh:mm:ss.mmm Examples: 1-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999The expected format is the same as that produced by encode.
inString
- the epoch in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double[] parse(java.lang.String[] inStrings) throws CDFException
Format: dd-mmm-yyyy hh:mm:ss.mmm Examples: 1-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999The expected format is the same as that produced by encode.
inStrings
- the epochs in string representationCDFException
- if a bad epoch value is passed in inStringspublic static double parse1(java.lang.String inString) throws CDFException
Format: yyyymmdd.ttttttt Examples: 19950508.0000000 19671231.58 (== 19671213.5800000)The expected format is the same as that produced by encode1.
inString
- the epoch in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double[] parse1(java.lang.String[] inStrings) throws CDFException
Format: yyyymmdd.ttttttt Examples: 19950508.0000000 19671231.58 (== 19671213.5800000)The expected format is the same as that produced by encode1.
inStrings
- the epoch array in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double parse2(java.lang.String inString) throws CDFException
Format: yyyymmddhhmmss Examples: 19950508000000 19671231235959The expected format is the same as that produced by encode2.
inString
- the epoch in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double[] parse2(java.lang.String[] inStrings) throws CDFException
Format: yyyymmddhhmmss Examples: 19950508000000 19671231235959The expected format is the same as that produced by encode2.
inStrings
- the epoch array in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double parse3(java.lang.String inString) throws CDFException
Format: yyyy-mm-ddThh:mm:ss.cccZ Examples: 1990-04-01T03:05:02.000Z 1993-10-10T23:45:49.999ZThe expected format is the same as that produced by encode3.
inString
- the epoch in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double[] parse3(java.lang.String[] inStrings) throws CDFException
Format: yyyy-mm-ddThh:mm:ss.cccZ Examples: 1990-04-01T03:05:02.000Z 1993-10-10T23:45:49.999ZThe expected format is the same as that produced by encode3.
inStrings
- the epoch array in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double parse4(java.lang.String inString) throws CDFException
Format: yyyy-mm-ddThh:mm:ss.ccc Examples: 1990-04-01T03:05:02.000 1993-10-10T23:45:49.999The expected format is the same as that produced by encode3.
inString
- the epoch in string representationCDFException
- if a bad epoch value is passed in inStringpublic static double[] parse4(java.lang.String[] inStrings) throws CDFException
Format: yyyy-mm-ddThh:mm:ss.ccc Examples: 1990-04-01T03:05:02.000 1993-10-10T23:45:49.999The expected format is the same as that produced by encode3.
inStrings
- the epoch array in string representationCDFException
- if a bad epoch value is passed in inStringpublic static java.lang.String toEncode(double epoch, int style)
For style 0: Format: dd-mmm-yyyy hh:mm:ss.ccc Examples: 01-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999 For style 1: Format: yyyymmdd.ttttttt Examples: 19950508.0000000 19671231.58 (== 19671213.5800000) For style 2: Format: yyyymmddhhmmss Examples: 19900401030502 19931010234549 For style 3: Format: yyyymmddThh:mm:ss.cccZ Examples: 19900401T03:05:02.000Z 19931010T23:45:49.999Z For style 4: Format: yyyymmddThh:mm:ss.ccc Examples: 19900401T03:05:02.000 19931010T23:45:49.999 The default style if the style is invalid.
epoch
- the epoch valuestyle
- the encoding stylepublic static java.lang.String[] toEncode(double[] epochs, int style)
For style 0: Format: dd-mmm-yyyy hh:mm:ss.ccc Examples: 01-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999 For style 1: Format: yyyymmdd.ttttttt Examples: 19950508.0000000 19671231.58 (== 19671213.5800000) For style 2: Format: yyyymmddhhmmss Examples: 19900401030502 19931010234549 For style 3: Format: yyyymmddThh:mm:ss.cccZ Examples: 19900401T03:05:02.000Z 19931010T23:45:49.999Z For style 4: Format: yyyymmddThh:mm:ss.ccc Examples: 19900401T03:05:02.000 19931010T23:45:49.999
epochs
- the epoch valuesstyle
- the encoding stylepublic static java.lang.Object toEncode(java.lang.Object epoch)
Format: yyyymmddThh:mm:ss.ccc Examples: 19900401T03:05:02.000 19931010T23:45:49.999
epoch
- the epoch objectpublic static java.lang.String toEncode(double epoch)
Format: yyyymmddThh:mm:ss.ccc Examples: 19900401T03:05:02.000 19931010T23:45:49.999
epoch
- the epoch valuepublic static java.lang.String[] toEncode(double[] epochs)
Format: yyyymmddThh:mm:ss.ccc Examples: 19900401T03:05:02.000 19931010T23:45:49.999
epochs
- the epoch valuespublic static double EpochtoUnixTime(double epoch)
epoch
- the epoch valuepublic static double[] EpochtoUnixTime(double[] epoch)
epoch
- the epoch valuespublic static double UnixTimetoEpoch(double unixTime)
unixTime
- the unix time valuepublic static double[] UnixTimetoEpoch(double[] unixTimes)
unixTimes
- the unix time valuespublic static java.lang.String encode(double epoch)
Format: dd-mmm-yyyy hh:mm:ss.ccc Examples: 01-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999This format is the same as that expected by parse.
epoch
- the epoch valuepublic static java.lang.String[] encode(double[] epochs)
Format: dd-mmm-yyyy hh:mm:ss.ccc Examples: 01-Apr-1990 03:05:02.000 10-Oct-1993 23:45:49.999This format is the same as that expected by parse.
epochs
- the epoch valuespublic static java.lang.String encode1(double epoch)
Format: yyyymmdd.ttttttt Examples: 19900401.3658893 19611231.0000000This format is the same as that expected by parse1.
epoch
- the epoch valuepublic static java.lang.String[] encode1(double[] epochs)
Format: yyyymmdd.ttttttt Examples: 19900401.3658893 19611231.0000000This format is the same as that expected by parse1.
epochs
- the epoch valuespublic static java.lang.String encode2(double epoch)
Format: yyyymmddhhmmss Examples: 19900401235959 19611231000000This format is the same as that expected by parse2.
epoch
- the epoch valuepublic static java.lang.String[] encode2(double[] epochs)
Format: yyyymmddhhmmss Examples: 19900401235959 19611231000000This format is the same as that expected by parse2.
epochs
- the epoch valuespublic static java.lang.String encode3(double epoch)
Format: yyyy-mm-ddThh:mm:ss.cccZ Examples: 1990-04-01T03:05:02.000Z 1993-10-10T23:45:49.999ZThis format is the same as that expected by parse3.
epoch
- the epoch valuepublic static java.lang.String[] encode3(double[] epochs)
Format: yyyy-mm-ddThh:mm:ss.cccZ Examples: 1990-04-01T03:05:02.000Z 1993-10-10T23:45:49.999ZThis format is the same as that expected by parse3.
epochs
- the epoch valuespublic static java.lang.String encode4(double epoch)
Format: yyyy-mm-ddThh:mm:ss.ccc Examples: 1990-04-01T03:05:02.000 1993-10-10T23:45:49.999This format is the same as that expected by parse3.
epoch
- the epoch valuepublic static java.lang.String[] encode4(double[] epochs)
Format: yyyy-mm-ddThh:mm:ss.ccc Examples: 1990-04-01T03:05:02.000 1993-10-10T23:45:49.999This format is the same as that expected by parse3.
epochs
- the epoch valuespublic static java.lang.String encodex(double epoch, java.lang.String formatString)
epoch
- the epoch valueformatString
- a string representing the desired
format of the epochpublic static double compute(long year, long month, long day, long hour, long minute, long second, long msec) throws CDFException
year
- the yearmonth
- the monthday
- the dayhour
- the hourminute
- the minutesecond
- the secondmsec
- the millisecondCDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static double[] compute(long[] year, long[] month, long[] day) throws CDFException
year
- the year arraymonth
- the month arrayday
- the day arrayCDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static double[] compute(long[] year, long[] month, long[] day, long[] hour) throws CDFException
year
- the year arraymonth
- the month arrayday
- the day arrayhour
- the hour arrayCDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static double[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute) throws CDFException
year
- the year arraymonth
- the month arrayday
- the day arrayhour
- the hour arrayminute
- the minute arrayCDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static double[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute, long[] second) throws CDFException
year
- the year arraymonth
- the month arrayday
- the day arrayhour
- the hour arrayminute
- the minute arraysecond
- the second arrayCDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static double[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute, long[] second, long[] msec) throws CDFException
year
- the year arraymonth
- the month arrayday
- the day arrayhour
- the hour arrayminute
- the minute arraysecond
- the second arraymsec
- the millisecond arrayCDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static long[] breakdown(double epoch)
epoch
- the epoch value to break downIndex | Part |
0 | year |
1 | month |
2 | day |
3 | hour |
4 | minute |
5 | second |
6 | msec |
public static long[][] breakdown(double[] epochs)
epochs
- the array of epoch values to break downIndex | Part |
0 | year |
1 | month |
2 | day |
3 | hour |
4 | minute |
5 | second |
6 | msec |