public final class TimeUtils extends Object
Modifier and Type | Method and Description |
---|---|
static long |
getUnitLengthMillis(String unit)
Gets the length of the given unit in milliseconds.
|
static org.joda.time.DateTime |
parseUdunitsTimeString(String baseDateTimeString)
Parses a UDUNITS time string (of the form "1992-10-8 15:15:42.5 -6:00")
and returns a DateTime in the ISO Chronology.
|
static org.joda.time.DateTime |
parseUdunitsTimeString(String baseDateTimeString,
org.joda.time.Chronology chronology)
Parses a UDUNITS time string (of the form "1992-10-8 15:15:42.5 -6:00")
and returns a DateTime in the given Chronology.
|
public static long getUnitLengthMillis(String unit)
public static org.joda.time.DateTime parseUdunitsTimeString(String baseDateTimeString)
baseDateTimeString
- UDUNITS-formatted time stringpublic static org.joda.time.DateTime parseUdunitsTimeString(String baseDateTimeString, org.joda.time.Chronology chronology)
baseDateTimeString
- UDUNITS-formatted time stringchronology
- The Chronology (calendar system) in which the time string
is to be interpreted. This must have a time zone of UTC, otherwise an
IllegalArgumentException will be thrown. If this is null, the ISOChronology
(in the UTC time zone) will be assumed.Copyright © 1999–2015 UCAR/Unidata. All rights reserved.