|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.util.TimeFormat
public class TimeFormat
Used for parsing and formatting dates and times.
Field Summary | |
---|---|
static TimeFormat |
DEFAULT
|
static TimeFormat |
GMT
|
Constructor Summary | |
---|---|
TimeFormat(java.util.TimeZone timezone)
Creates new TimeFormat with specified timezone. |
Method Summary | |
---|---|
java.lang.String |
formatDateTime(java.util.Date time)
Converts Date into String, formatted like yyyyMMdd-HHmmssZ. |
java.lang.String |
formatDateTimeWithMillisWithoutTimeZone(java.util.Date time)
Converts Date into String, formatted like yyyyMMdd-HHmmss.SSS. |
java.lang.String |
formatDateTimeWithoutTimeZone(java.util.Date time)
Converts Date into String, formatted like yyyyMMdd-HHmmss. |
java.util.TimeZone |
getTimeZone()
Returns default timezone of current TimeFormat. |
java.util.Date |
parseDateTime(java.lang.String value)
Reads Date from String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final TimeFormat DEFAULT
public static final TimeFormat GMT
Constructor Detail |
---|
public TimeFormat(java.util.TimeZone timezone)
timezone
- default timezone for this TimeFormat.
java.lang.NullPointerException
- if timezone is null.Method Detail |
---|
public java.util.Date parseDateTime(java.lang.String value) throws InvalidFormatException, java.lang.NullPointerException
It accepts the following formats of date:
TimePeriod.valueOf(String)
.
SimpleDateFormat
.
value
- String value to parse.
InvalidFormatException
- if value has wrong format.
java.lang.NullPointerException
- if value == null.SimpleDateFormat
public java.lang.String formatDateTime(java.util.Date time) throws java.lang.NullPointerException
time
- Date to format.
java.lang.NullPointerException
- if time is null.public java.lang.String formatDateTimeWithoutTimeZone(java.util.Date time) throws java.lang.NullPointerException
formatDateTime(java.util.Date)
, it doesn't declare time zone and
formats time in current time zone.
time
- Date to format.
java.lang.NullPointerException
- if time is null.public java.lang.String formatDateTimeWithMillisWithoutTimeZone(java.util.Date time) throws java.lang.NullPointerException
formatDateTime(java.util.Date)
, it doesn't declare time zone and
formats time in current time zone.
time
- Date to format.
java.lang.NullPointerException
- if time is null.public java.util.TimeZone getTimeZone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |