public class Iso8601 extends Object
fixSeconds
fixes this and there are regression tests to catch this now as well.Constructor and Description |
---|
Iso8601() |
Modifier and Type | Method and Description |
---|---|
static String |
date2String(Calendar c)
Convert a date to a string in the format
|
static String |
date2String(Date d)
Convert a date to a string in the format
|
static String |
date2String(long d)
Convert a date to a string in the format
|
protected static String |
fixSeconds(String rawDate)
This normalizes the date so that it always has 3 places for the number of milliseconds.
|
static DateFormat |
getDateFormat()
Provides the DateFormat used by this utility.
|
static DateFormat |
getUTCDateFormat()
Provides the date format for UTC used by this utility.
|
protected static Calendar |
mintCalendar() |
static String[] |
splitDate(String rawDate) |
static Calendar |
string2Date(String s)
Convert a string in the format
|
protected static String zeros
public static String date2String(long d)
where "Z" represents UTC.yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
d
- the date in millisecondspublic static String date2String(Date d)
where "Z" represents UTC.yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
d
- the datepublic static String date2String(Calendar c)
where "Z" represents UTC.yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
c
- the datepublic static DateFormat getUTCDateFormat()
public static DateFormat getDateFormat()
protected static String fixSeconds(String rawDate) throws ParseException
rawDate
- ParseException
public static String[] splitDate(String rawDate) throws ParseException
ParseException
public static Calendar string2Date(String s) throws ParseException
where tzd is either "Z" for UTC or an offset in the format [+-]hh:mm to a date.yyyy-MM-dd'T'HH:mm:ss.S[tzd]
s
- ParseException
protected static Calendar mintCalendar()
Copyright © 2019. All Rights Reserved.