|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ehealth.technicalconnector.utils.DateUtils
public final class DateUtils
Utility class to work with dates
Method Summary | |
---|---|
static org.joda.time.DateTime |
convert(Calendar cal)
Converts an java.util.Calendar to an org.joda.DateTime |
static org.joda.time.DateTime |
convert(Date date)
Converts an java.util.Date to an org.joda.DateTime |
static org.joda.time.DateTime |
parseDate(String text)
Parses a date from the given text, returning a new DateTime. |
static org.joda.time.DateTime |
parseDateTime(String text)
Parses a datetime from the given text, returning a new DateTime. |
static org.joda.time.DateTime |
parseTime(String text)
Parses a time from the given text, returning a new DateTime. |
static String |
printDate(org.joda.time.DateTime dateTime)
Parses the dateTime, returning a string. |
static String |
printDateTime(org.joda.time.DateTime dateTime)
Combines the date and time by using the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZZ |
static String |
printTime(org.joda.time.DateTime dateTime)
Gives the time by using the following format: HH:mm:ss.SSSZZ |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static org.joda.time.DateTime parseDateTime(String text)
The parse will use the zone and chronology specified on this formatter.
If the text contains a time zone string then that will be taken into account in adjusting the time of day as follows. The the resulting DateTime will have the zone of this formatter, but the parsed zone may have caused the time to be adjusted.
datetime = time | date-opt-time time = 'T' time-element [offset] date-opt-time = date-element ['T' [time-element] [offset]] date-element = std-date-element | ord-date-element | week-date-element std-date-element = yyyy ['-' MM ['-' dd]] ord-date-element = yyyy ['-' DDD] week-date-element = xxxx '-W' ww ['-' e] time-element = HH [minute-element] | [fraction] minute-element = ':' mm [second-element] | [fraction] second-element = ':' ss [fraction] fraction = ('.' | ',') digit+ offset = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])for example: 2012-10-15T05:38:14.030+02:00
text
-
public static String printDateTime(org.joda.time.DateTime dateTime)
dateTime
-
public static org.joda.time.DateTime parseTime(String text)
The parse will use the zone and chronology specified on this formatter.
If the text contains a time zone string then that will be taken into account in adjusting the time of day as follows. The the resulting DateTime will have the zone of this formatter, but the parsed zone may have caused the time to be adjusted.
time = ['T'] time-element [offset] time-element = HH [minute-element] | [fraction] minute-element = ':' mm [second-element] | [fraction] second-element = ':' ss [fraction] fraction = ('.' | ',') digit+ offset = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])
text
-
public static String printTime(org.joda.time.DateTime dateTime)
dateTime
-
public static org.joda.time.DateTime parseDate(String text)
The parse will use the zone and chronology specified on this formatter.
If the text contains a time zone string then that will be taken into account in adjusting the time of day as follows. The the resulting DateTime will have the zone of this formatter, but the parsed zone may have caused the time to be adjusted.
date = date-element ['T' offset] date-element = std-date-element | ord-date-element | week-date-element std-date-element = yyyy ['-' MM ['-' dd]] ord-date-element = yyyy ['-' DDD] week-date-element = xxxx '-W' ww ['-' e] offset = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])
text
-
public static String printDate(org.joda.time.DateTime dateTime)
The parse will use the zone and chronology specified on this formatter.
dateTime
-
public static org.joda.time.DateTime convert(Calendar cal)
cal
-
public static org.joda.time.DateTime convert(Date date)
date
- the date
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |