public class EpochNative
extends java.lang.Object
// 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));
// Print out the date using format
String format = "<month> <dom.02>, <year> at <hour>:<min>";
System.out.println(Epoch.encodex(ep,format));
| Constructor and Description |
|---|
EpochNative() |
| Modifier and Type | Method and Description |
|---|---|
static long[] |
breakdown(double epoch)
Mirrors EPOCHbreakdown from the CDF library.
|
static double |
compute(long year,
long month,
long day,
long hour,
long minute,
long second,
long msec)
Mirrors computeEPOCH from the CDF library.
|
static java.lang.String |
encode(double epoch)
Mirrors encodeEPOCH from the CDF library.
|
static java.lang.String |
encode1(double epoch)
Mirrors encodeEPOCH1 from the CDF library.
|
static java.lang.String |
encode2(double epoch)
Mirrors encodeEPOCH2 from the CDF library.
|
static java.lang.String |
encode3(double epoch)
Mirrors encodeEPOCH3 from the CDF library.
|
static java.lang.String |
encode4(double epoch)
Mirrors encodeEPOCH4 from the CDF library.
|
static java.lang.String |
encodex(double epoch,
java.lang.String format)
Mirrors encodeEPOCHx from the CDF library.
|
static double |
parse(java.lang.String sEpoch)
Mirrors parseEPOCH from CDF library.
|
static double |
parse1(java.lang.String sEpoch)
Mirrors parseEPOCH from CDF library.
|
static double |
parse2(java.lang.String sEpoch)
Mirrors parseEPOCH from CDF library.
|
static double |
parse3(java.lang.String sEpoch)
Mirrors parseEPOCH from CDF library.
|
static double |
parse4(java.lang.String sEpoch)
Mirrors parseEPOCH from CDF library.
|
public static double compute(long year,
long month,
long day,
long hour,
long minute,
long second,
long msec)
year - the year componmentmonth - the month componmentday - the day componmenthour - the hour componmentminute - the minute componmentsecond - the second componmentmsec - the millisecond componmentpublic static long[] breakdown(double epoch)
epoch - the epoch, milliseconds since 0ADpublic static java.lang.String encode(double epoch)
epoch - the epoch, milliseconds since 0ADpublic static java.lang.String encode1(double epoch)
epoch - the epoch, milliseconds since 0ADpublic static java.lang.String encode2(double epoch)
epoch - the epoch, milliseconds since 0ADpublic static java.lang.String encode3(double epoch)
epoch - the epoch, milliseconds since 0ADpublic static java.lang.String encode4(double epoch)
epoch - the epoch, milliseconds since 0ADpublic static java.lang.String encodex(double epoch,
java.lang.String format)
epoch - the epoch, milliseconds since 0ADformat - the format to encode the stringpublic static double parse(java.lang.String sEpoch)
sEpoch - the epoch stringpublic static double parse1(java.lang.String sEpoch)
sEpoch - the epoch stringpublic static double parse2(java.lang.String sEpoch)
sEpoch - the epoch stringpublic static double parse3(java.lang.String sEpoch)
sEpoch - the epoch stringpublic static double parse4(java.lang.String sEpoch)
sEpoch - the epoch string