public final class DateTimeFormat extends Object
When a date and time need to be specified in a single string, the ICE Date and Time Format is: CCYY-MM-DDThh:mm:ss,s where "T" (upper case letter T) is a literal character ([ISO8601] designator).
Copyright 2004 SAP AG
| Constructor and Description |
|---|
DateTimeFormat() |
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Date date)
Formats the specified
java.util.Date object as a string
adhering to the ICE Date and Time Format. |
static Date |
parse(String str)
Parses the specified string (which must be in ICE Date and TIME Format)
and returns it as a
java.util.Date object. |
public static String format(Date date)
java.util.Date object as a string
adhering to the ICE Date and Time Format. Note, that the date will be converted to UTC (if not already in UTC) prior formatting it to the ICE Date and Time Format. For example, the date July 1st 2002 01:00:00 AM (GMT+2) will be converted to June 30th 2002 11:00:00 PM (UTC) and returned as "2002-06-30T23:00:00".
date - the date to be formattedpublic static Date parse(String str) throws ParseException
java.util.Date object. Note, that the parsed date will be interpreted as UTC and converted into the local time. For example, on a machine with local timezone GMT+2, the string "2002-06-30T23:00:00" will be interpreted as June 30th 2002 11:00:00 PM (UTC) and converted to July 1st 2002 01:00:00 AM (GMT+2).
To conclude, this method is the exact inverse of the method
format.
str - the string to be parsedjava.util.Date object
containing the parsed dateParseException - when specifying an illegally formatted string| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice