public final class UtcDate
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_PATTERN
Default time format
|
static java.util.TimeZone |
GMT
GMT Timezone
|
static java.lang.String |
HH_FORMAT
hour format string (HH)
|
static java.lang.String |
HH_MM_FORMAT
hour:minute format string (HH:mm)
|
static java.lang.String |
HMS_FORMAT
hour:minute:second format string (HH:mm:ss)
|
static java.lang.String |
IYD_FORMAT
Year-Day format string
|
static java.lang.String |
JDAY_FORMAT
Julian day format string
|
static java.lang.String |
MACRO_TIMESTAMP
timestamp macro identifier
|
static java.lang.String |
TEMPLATE_TIMEFORMAT
timestamp macro identifier
|
static java.lang.String |
YMD_FORMAT
Year-Month-Day format string
|
Constructor and Description |
---|
UtcDate()
default constructor
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
applyTimeMacro(java.lang.String template,
visad.DateTime dttm)
Apply the timestamp macro to the string
|
static java.lang.String |
applyTimeMacro(java.lang.String template,
visad.DateTime dttm,
java.lang.String noTimeLabel)
Apply the timestamp macro to the string
|
static java.lang.String |
applyTimeMacro(java.lang.String template,
visad.DateTime dttm,
java.lang.String noTimeLabel,
java.lang.String prefix,
java.lang.String suffix)
Apply the timestamp macro to the string
|
static java.lang.String |
applyTimeMacro(java.lang.String template,
visad.DateTime dttm,
java.lang.String noTimeLabel,
java.lang.String prefix,
java.lang.String suffix,
java.util.TimeZone tz)
Apply the timestamp macro to the string
|
static java.lang.String |
applyTimeMacro(java.lang.String template,
visad.DateTime dttm,
java.util.TimeZone tz)
Apply the timestamp macro to the string
|
static boolean |
containsTimeMacro(java.lang.String s)
See if the string contains a timestamp macro
|
static boolean |
containsTimeMacro(java.lang.String s,
java.lang.String prefix)
Does this string contain a time macro
|
static int[] |
convertDateTimeToJulianDay(visad.DateTime[] dates)
Convert an array of DateTime objects to an array of the Julian day of each date
|
static int[] |
convertDateTimeToJulianDay(visad.Gridded1DSet timeSet)
Convert the time set to an array of the Julian days of each date in the set
|
static visad.DateTime |
createDateTime(java.lang.String dateString)
Create a DateTime object.
|
static visad.DateTime |
createDateTime(java.lang.String dateString,
java.lang.String pattern)
Create a DateTime object.
|
static visad.DateTime |
createDateTime(java.lang.String dateString,
java.lang.String pattern,
java.util.TimeZone tz)
Create a DateTime object.
|
static visad.DateTime |
createDateTime(java.lang.String dateString,
java.lang.String pattern,
java.util.TimeZone tz,
ucar.nc2.time.Calendar cal)
Create a DateTime object.
|
static java.lang.String |
formatUtcDate(visad.DateTime dt,
java.lang.String pattern)
Return a formated date in UTC time.
|
static java.lang.String |
formatUtcDate(visad.DateTime dt,
java.lang.String pattern,
java.util.TimeZone tz)
Return a formated date in UTC time.
|
static java.lang.String |
getHH(visad.DateTime dt)
Get the hour as a String.
|
static java.lang.String |
getHH(visad.DateTime dt,
java.util.TimeZone tz)
Get the hour as a String.
|
static java.lang.String |
getHHMM(visad.DateTime dt)
Get the hour:minute as a String.
|
static java.lang.String |
getHHMM(visad.DateTime dt,
java.util.TimeZone tz)
Get the hour:minute as a String.
|
static java.lang.String |
getHMS(visad.DateTime dt)
Get the hour/minute/second as a String
|
static java.lang.String |
getHMS(visad.DateTime dt,
java.util.TimeZone tz)
Get the hour/minute/second as a String
|
static java.lang.String |
getIYD(visad.DateTime dt)
Get the year.jday (IYD_FORMAT) as a String
|
static java.lang.String |
getIYD(visad.DateTime dt,
java.util.TimeZone tz)
Get the year.jday (IYD_FORMAT) as a String
|
static java.lang.String |
getUtcDate(visad.DateTime dt)
Get the full datetime using the DEFAULT_PATTERN
|
static java.lang.String |
getYMD(visad.DateTime dt)
Get the year-month-day as a String
|
static java.lang.String |
getYMD(visad.DateTime dt,
java.util.TimeZone tz)
Get the year-month-day as a String
|
public static final java.lang.String MACRO_TIMESTAMP
public static final java.lang.String TEMPLATE_TIMEFORMAT
public static final java.lang.String YMD_FORMAT
public static final java.lang.String HMS_FORMAT
public static final java.lang.String HH_MM_FORMAT
public static final java.lang.String HH_FORMAT
public static final java.lang.String IYD_FORMAT
public static final java.lang.String JDAY_FORMAT
public static final java.util.TimeZone GMT
public static final java.lang.String DEFAULT_PATTERN
public static java.lang.String getHH(visad.DateTime dt)
dt
- DateTime to usepublic static java.lang.String getHH(visad.DateTime dt, java.util.TimeZone tz)
dt
- DateTime to usetz
- the TimeZone to usepublic static boolean containsTimeMacro(java.lang.String s)
s
- the stringpublic static boolean containsTimeMacro(java.lang.String s, java.lang.String prefix)
s
- the stringprefix
- the prefixpublic static java.lang.String applyTimeMacro(java.lang.String template, visad.DateTime dttm)
template
- the timestamp templatedttm
- the DateTimepublic static java.lang.String applyTimeMacro(java.lang.String template, visad.DateTime dttm, java.util.TimeZone tz)
template
- the timestamp templatedttm
- the DateTimetz
- the TimeZone to usepublic static java.lang.String applyTimeMacro(java.lang.String template, visad.DateTime dttm, java.lang.String noTimeLabel)
template
- the timestamp templatedttm
- the DateTimenoTimeLabel
- the label if dttm is null;public static java.lang.String applyTimeMacro(java.lang.String template, visad.DateTime dttm, java.lang.String noTimeLabel, java.lang.String prefix, java.lang.String suffix)
template
- the timestamp templatedttm
- the DateTimenoTimeLabel
- the label if dttm is null;prefix
- macro prefixsuffix
- macro suffixpublic static java.lang.String applyTimeMacro(java.lang.String template, visad.DateTime dttm, java.lang.String noTimeLabel, java.lang.String prefix, java.lang.String suffix, java.util.TimeZone tz)
template
- the timestamp templatedttm
- the DateTimenoTimeLabel
- the label if dttm is null;prefix
- macro prefixsuffix
- macro suffixtz
- TimeZonepublic static java.lang.String getHHMM(visad.DateTime dt)
dt
- DateTime to usepublic static java.lang.String getHHMM(visad.DateTime dt, java.util.TimeZone tz)
dt
- DateTime to usetz
- the TimeZone to usepublic static java.lang.String getYMD(visad.DateTime dt)
dt
- DateTime to usepublic static java.lang.String getYMD(visad.DateTime dt, java.util.TimeZone tz)
dt
- DateTime to usetz
- the TimeZone to usepublic static java.lang.String getHMS(visad.DateTime dt)
dt
- DateTime to usepublic static java.lang.String getHMS(visad.DateTime dt, java.util.TimeZone tz)
dt
- DateTime to usetz
- the TimeZone to usepublic static java.lang.String getUtcDate(visad.DateTime dt)
dt
- DateTime to usepublic static java.lang.String getIYD(visad.DateTime dt)
dt
- DateTime to usepublic static java.lang.String getIYD(visad.DateTime dt, java.util.TimeZone tz)
dt
- DateTime to usetz
- the TimeZone to usepublic static java.lang.String formatUtcDate(visad.DateTime dt, java.lang.String pattern)
dt
- DateTime objectpattern
- format patternpublic static java.lang.String formatUtcDate(visad.DateTime dt, java.lang.String pattern, java.util.TimeZone tz)
dt
- DateTime objectpattern
- format patterntz
- the TimeZone to usepublic static int[] convertDateTimeToJulianDay(visad.DateTime[] dates)
dates
- array of datespublic static int[] convertDateTimeToJulianDay(visad.Gridded1DSet timeSet) throws visad.VisADException
timeSet
- set of datesvisad.VisADException
- set must have type of RealType.Timepublic static visad.DateTime createDateTime(java.lang.String dateString) throws visad.VisADException
dateString
- the string specifying the datevisad.VisADException
- problem decoding string or creating Data objectpublic static visad.DateTime createDateTime(java.lang.String dateString, java.lang.String pattern) throws visad.VisADException
dateString
- the string specifying the datepattern
- the format patternvisad.VisADException
- problem decoding string or creating Data objectpublic static visad.DateTime createDateTime(java.lang.String dateString, java.lang.String pattern, java.util.TimeZone tz) throws visad.VisADException
dateString
- the string specifying the datepattern
- the format patterntz
- the associated time zonevisad.VisADException
- problem decoding string or creating Data objectpublic static visad.DateTime createDateTime(java.lang.String dateString, java.lang.String pattern, java.util.TimeZone tz, ucar.nc2.time.Calendar cal) throws visad.VisADException
dateString
- the string specifying the datepattern
- the format patterntz
- the associated time zonecal
- the associated Calendarvisad.VisADException
- problem decoding string or creating Data object