|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.visad.UtcDate
public final class UtcDate
A set of utility functions for UTC DateTimes
| Field Summary | |
|---|---|
static String |
DEFAULT_PATTERN
Default time format |
static TimeZone |
GMT
GMT Timezone |
static String |
HH_FORMAT
hour format string (HH) |
static String |
HH_MM_FORMAT
hour:minute format string (HH:mm) |
static String |
HMS_FORMAT
hour:minute:second format string (HH:mm:ss) |
static String |
IYD_FORMAT
Year-Day format string |
static String |
JDAY_FORMAT
Julian day format string |
static String |
MACRO_TIMESTAMP
timestamp macro identifier |
static String |
TEMPLATE_TIMEFORMAT
timestamp macro identifier |
static String |
YMD_FORMAT
Year-Month-Day format string |
| Constructor Summary | |
|---|---|
UtcDate()
default constructor |
|
| Method Summary | |
|---|---|
static String |
applyTimeMacro(String template,
DateTime dttm)
Apply the timestamp macro to the string |
static String |
applyTimeMacro(String template,
DateTime dttm,
String noTimeLabel)
Apply the timestamp macro to the string |
static String |
applyTimeMacro(String template,
DateTime dttm,
String noTimeLabel,
String prefix,
String suffix)
Apply the timestamp macro to the string |
static String |
applyTimeMacro(String template,
DateTime dttm,
String noTimeLabel,
String prefix,
String suffix,
TimeZone tz)
Apply the timestamp macro to the string |
static String |
applyTimeMacro(String template,
DateTime dttm,
TimeZone tz)
Apply the timestamp macro to the string |
static boolean |
containsTimeMacro(String s)
See if the string contains a timestamp macro |
static boolean |
containsTimeMacro(String s,
String prefix)
Does this string contain a time macro |
static int[] |
convertDateTimeToJulianDay(DateTime[] dates)
Convert an array of DateTime objects to an array of the Julian day of each date |
static int[] |
convertDateTimeToJulianDay(Gridded1DSet timeSet)
Convert the time set to an array of the Julian days of each date in the set |
static DateTime |
createDateTime(String dateString)
Create a DateTime object. |
static DateTime |
createDateTime(String dateString,
String pattern)
Create a DateTime object. |
static DateTime |
createDateTime(String dateString,
String pattern,
TimeZone tz)
Create a DateTime object. |
static DateTime |
createDateTime(String dateString,
String pattern,
TimeZone tz,
ucar.nc2.time.Calendar cal)
Create a DateTime object. |
static String |
formatUtcDate(DateTime dt,
String pattern)
Return a formated date in UTC time. |
static String |
formatUtcDate(DateTime dt,
String pattern,
TimeZone tz)
Return a formated date in UTC time. |
static String |
getHH(DateTime dt)
Get the hour as a String. |
static String |
getHH(DateTime dt,
TimeZone tz)
Get the hour as a String. |
static String |
getHHMM(DateTime dt)
Get the hour:minute as a String. |
static String |
getHHMM(DateTime dt,
TimeZone tz)
Get the hour:minute as a String. |
static String |
getHMS(DateTime dt)
Get the hour/minute/second as a String |
static String |
getHMS(DateTime dt,
TimeZone tz)
Get the hour/minute/second as a String |
static String |
getIYD(DateTime dt)
Get the year.jday (IYD_FORMAT) as a String |
static String |
getIYD(DateTime dt,
TimeZone tz)
Get the year.jday (IYD_FORMAT) as a String |
static String |
getUtcDate(DateTime dt)
Get the full datetime using the DEFAULT_PATTERN |
static String |
getYMD(DateTime dt)
Get the year-month-day as a String |
static String |
getYMD(DateTime dt,
TimeZone tz)
Get the year-month-day as 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 String MACRO_TIMESTAMP
public static final String TEMPLATE_TIMEFORMAT
public static final String YMD_FORMAT
public static final String HMS_FORMAT
public static final String HH_MM_FORMAT
public static final String HH_FORMAT
public static final String IYD_FORMAT
public static final String JDAY_FORMAT
public static final TimeZone GMT
public static final String DEFAULT_PATTERN
| Constructor Detail |
|---|
public UtcDate()
| Method Detail |
|---|
public static String getHH(DateTime dt)
dt - DateTime to use
public static String getHH(DateTime dt,
TimeZone tz)
dt - DateTime to usetz - the TimeZone to use
public static boolean containsTimeMacro(String s)
s - the string
public static boolean containsTimeMacro(String s,
String prefix)
s - the stringprefix - the prefix
public static String applyTimeMacro(String template,
DateTime dttm)
template - the timestamp templatedttm - the DateTime
public static String applyTimeMacro(String template,
DateTime dttm,
TimeZone tz)
template - the timestamp templatedttm - the DateTimetz - the TimeZone to use
public static String applyTimeMacro(String template,
DateTime dttm,
String noTimeLabel)
template - the timestamp templatedttm - the DateTimenoTimeLabel - the label if dttm is null;
public static String applyTimeMacro(String template,
DateTime dttm,
String noTimeLabel,
String prefix,
String suffix)
template - the timestamp templatedttm - the DateTimenoTimeLabel - the label if dttm is null;prefix - macro prefixsuffix - macro suffix
public static String applyTimeMacro(String template,
DateTime dttm,
String noTimeLabel,
String prefix,
String suffix,
TimeZone tz)
template - the timestamp templatedttm - the DateTimenoTimeLabel - the label if dttm is null;prefix - macro prefixsuffix - macro suffixtz - TimeZone
public static String getHHMM(DateTime dt)
dt - DateTime to use
public static String getHHMM(DateTime dt,
TimeZone tz)
dt - DateTime to usetz - the TimeZone to use
public static String getYMD(DateTime dt)
dt - DateTime to use
public static String getYMD(DateTime dt,
TimeZone tz)
dt - DateTime to usetz - the TimeZone to use
public static String getHMS(DateTime dt)
dt - DateTime to use
public static String getHMS(DateTime dt,
TimeZone tz)
dt - DateTime to usetz - the TimeZone to use
public static String getUtcDate(DateTime dt)
dt - DateTime to use
public static String getIYD(DateTime dt)
dt - DateTime to use
public static String getIYD(DateTime dt,
TimeZone tz)
dt - DateTime to usetz - the TimeZone to use
public static String formatUtcDate(DateTime dt,
String pattern)
dt - DateTime objectpattern - format pattern
public static String formatUtcDate(DateTime dt,
String pattern,
TimeZone tz)
dt - DateTime objectpattern - format patterntz - the TimeZone to use
public static int[] convertDateTimeToJulianDay(DateTime[] dates)
dates - array of dates
public static int[] convertDateTimeToJulianDay(Gridded1DSet timeSet)
throws VisADException
timeSet - set of dates
VisADException - set must have type of RealType.Time
public static DateTime createDateTime(String dateString)
throws VisADException
dateString - the string specifying the date
VisADException - problem decoding string or creating Data object
public static DateTime createDateTime(String dateString,
String pattern)
throws VisADException
dateString - the string specifying the datetz - the associated time zonepattern - the format pattern
VisADException - problem decoding string or creating Data object
public static DateTime createDateTime(String dateString,
String pattern,
TimeZone tz)
throws VisADException
dateString - the string specifying the datepattern - the format patterntz - the associated time zone
VisADException - problem decoding string or creating Data object
public static DateTime createDateTime(String dateString,
String pattern,
TimeZone tz,
ucar.nc2.time.Calendar cal)
throws VisADException
dateString - the string specifying the datepattern - the format patterntz - the associated time zonecal - the associated Calendar
VisADException - problem decoding string or creating Data object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||