|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.esa.beam.util.DateTimeUtils
public class DateTimeUtils
This utility class provides some date/time related methods.
Date| Field Summary | |
|---|---|
static double |
HOURS_PER_DAY
The number of hours per day. |
static SimpleDateFormat |
ISO_8601_FORMAT
An ISO 8601 date/time format. |
static double |
JD_OFFSET
The number of days from noon Jan 1, 4713 BC (Proleptic Julian) to midnight 1/1/1970 AD (Gregorian). |
static double |
MICROS_PER_DAY
The number of micro-seconds per day. |
static double |
MILLIS_PER_DAY
The number of milli-seconds per day. |
static double |
MJD_OFFSET
The Modified Julian Day (MJD) gives the number of days since midnight on November 17, 1858. |
static double |
SECONDS_PER_DAY
The number of seconds per day. |
| Constructor Summary | |
|---|---|
DateTimeUtils()
|
|
| Method Summary | |
|---|---|
static double |
jdToMJD(double jd)
Converts a julian day (JD) to a modified julian day (MJD) value. |
static Date |
jdToUTC(double jd)
Converts a julian day (JD) to a UTC date/time value. |
static double |
mjdToJD(double mjd)
Converts a modified julian day (MJD) to a julian day (JD) value. |
static Date |
stringToUTC(String utc)
Converts a UTC date/time string to a UTC date/time value. |
static double |
utcToJD(Date utc)
Converts a UTC date/time value to a julian day (JD). |
static String |
utcToString(Date utc)
Converts a UTC date/time value to a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SimpleDateFormat ISO_8601_FORMAT
public static final double JD_OFFSET
public static final double MJD_OFFSET
MJD_OFFSET = 2400000.5 days after day zero of the Julian calendar.
public static final double HOURS_PER_DAY
public static final double SECONDS_PER_DAY
public static final double MILLIS_PER_DAY
public static final double MICROS_PER_DAY
| Constructor Detail |
|---|
public DateTimeUtils()
| Method Detail |
|---|
public static double jdToMJD(double jd)
jd - the julian day
public static double mjdToJD(double mjd)
mjd - the modified julian day
public static Date jdToUTC(double jd)
Important note: Due to the limitations of java.util.Date this method does not
take leap seconds into account.
jd - the julian day
public static double utcToJD(Date utc)
Important note: Due to the limitations of java.util.Date this method does not
take leap seconds into account.
utc - the UTC date/time, if null the current time is converted
public static String utcToString(Date utc)
YYYY-MM-DD
hh:mm:ss.S
Important note: Due to the limitations of java.util.Date this method does not
take leap seconds into account.
utc - the UTC date/time value
public static Date stringToUTC(String utc)
throws ParseException
YYYY-MM-DD hh:mm:ss.S
Important note: Due to the limitations of java.util.Date this method does not
take leap seconds into account.
utc - the UTC date/time string
ParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||