public class DateConvert extends Object
DateConvert
class is intended to provide date/time
conversion and parse routines. For a description of the syntax of the
format strings see SimpleDateFormat
.Modifier and Type | Field and Description |
---|---|
static int |
BEGIN_INDEX |
static int |
ERROR_OFFSET |
static int |
ERROR_OFFSET1 |
static int |
INT |
Constructor and Description |
---|
DateConvert()
Constructor given no arguments.
|
Modifier and Type | Method and Description |
---|---|
static String |
dbmsFormat(Date inputDate)
Format the given date and return the resulting string in a DBMS
format.
|
static Date |
dbmsParse(String inputString)
Parse the given date/time string in DBMS format
and return the resulting
Date object. |
static String |
doyFormat(Date inputDate)
Format the given date and return the resulting string in CCSDS
ASCII Time Code B format.
|
static Date |
doyParse(String inputString)
Parse the given date/time string in CCSDS ASCII Time Code B format
and return the resulting
Date object. |
static long |
getMsecsInDay()
Get the number of milliseconds in a day.
|
static long |
getMsecsInHour()
Get the number of milliseconds in an hour.
|
static long |
getMsecsInMinute()
Get the number of milliseconds in a minute.
|
static String |
isoFormat(Date inputDate)
Format the given date and return the resulting string in ISO 8601 format.
|
static Date |
isoParse(String inputString)
Parse the given date/time string in ISO 8601 format and return the
resulting
Date object. |
static String |
tsFormat(Date inputDate)
Format the given date and return the resulting string in a timestamp
format.
|
static Date |
tsParse(String inputString)
Parse the given date/time string in timestamp format
and return the resulting
Date object. |
static String |
ymdFormat(Date inputDate)
Format the given date and return the resulting string in a
year-month-day format.
|
static Date |
ymdParse(String inputString)
Parse the given date/time string in year-month-day format
and return the resulting
Date object. |
public static final int INT
public static final int BEGIN_INDEX
public static final int ERROR_OFFSET
public static final int ERROR_OFFSET1
public DateConvert() throws IllegalStateException
IllegalStateException
- If the class is instantiated.public static String isoFormat(Date inputDate)
inputDate
- The date to be converted into string format.public static Date isoParse(String inputString) throws ParseException
Date
object.
The format is as follows: "yyyy-MM-dd'T'HH:mm:ss.SSS[Z|[+|-]HH:mm]".inputString
- The string to be parsed.ParseException
- If the string is null or does not match the date/time
format.public static String doyFormat(Date inputDate)
inputDate
- The date to be converted into string format.public static Date doyParse(String inputString) throws ParseException
Date
object.
The format is as follows: "yyyy-DDD'T'HH:mm:ss.SSS".inputString
- The string to be parsed.ParseException
- If the string does not match the date/time
format.public static String tsFormat(Date inputDate)
inputDate
- The date to be converted into string format.public static Date tsParse(String inputString) throws ParseException
Date
object.
The format is as follows: "yyyyMMddHHmmssSSS".inputString
- The string to be parsed.ParseException
- If the string does not match the date/time
format.public static String dbmsFormat(Date inputDate)
inputDate
- The date to be converted into string format.public static Date dbmsParse(String inputString) throws ParseException
Date
object.
The format is as follows: "dd-MMM-yyyy HH:mm:ss".inputString
- The string to be parsed.ParseException
- If the string does not match the date/time
format.public static String ymdFormat(Date inputDate)
inputDate
- The date to be converted into string format.public static Date ymdParse(String inputString) throws ParseException
Date
object.
The format is as follows: "yyyy-MM-dd".inputString
- The string to be parsed.ParseException
- If the string does not match the date/time
format.public static long getMsecsInMinute()
public static long getMsecsInHour()
public static long getMsecsInDay()
Copyright © 1999–2017 Apache OODT. All rights reserved.