public final class DateUtils extends Object
Modifier and Type | Method and Description |
---|---|
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 lexicalXSDDate)
Parses a date from the given lexicalXSDDate, returning a new DateTime.
|
static org.joda.time.DateTime |
parseDateTime(String lexicalXSDDate)
Parses a datetime from the given lexicalXSDDate, returning a new DateTime.
|
static org.joda.time.DateTime |
parseTime(String lexicalXSDDate)
Parses a time from the given lexicalXSDDate, 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 |
printDateWithoutTimeZone(org.joda.time.DateTime dateTime)
Parses the dateTime, returning a string without timezone.
|
static String |
printTime(org.joda.time.DateTime dateTime)
Gives the time by using the following format: HH:mm:ss.SSSZZ
|
static String |
printTimeWithoutTimezone(org.joda.time.DateTime dateTime)
Gives the time by using the following format: HH:mm:ss.SSSZZ
|
public static org.joda.time.DateTime parseDateTime(String lexicalXSDDate)
The parse will use the zone and chronology specified on this formatter.
If the lexicalXSDDate 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
lexicalXSDDate
- public static String printDateTime(org.joda.time.DateTime dateTime)
dateTime
- public static org.joda.time.DateTime parseTime(String lexicalXSDDate)
The parse will use the zone and chronology specified on this formatter.
If the lexicalXSDDate 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]]])
lexicalXSDDate
- public static String printTime(org.joda.time.DateTime dateTime)
dateTime
- public static String printTimeWithoutTimezone(org.joda.time.DateTime dateTime)
dateTime
- public static org.joda.time.DateTime parseDate(String lexicalXSDDate)
The parse will use the zone and chronology specified on this formatter.
If the lexicalXSDDate 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.
lexicalXSDDate
- public static String printDate(org.joda.time.DateTime dateTime)
The parse will use the zone and chronology specified on this formatter.
dateTime
- public static String printDateWithoutTimeZone(org.joda.time.DateTime dateTime)
The resulting format is yyyy-MM-dd
dateTime
- public static org.joda.time.DateTime convert(Calendar cal)
cal
- public static org.joda.time.DateTime convert(Date date)
date
- the date
Connector Packaging TECHNICAL 4.3.0-beta-3 API
Copyright © {inceptionYear}-2022 eHealth. All Rights Reserved.