Class UnlocalizedDateTimeFormat
- java.lang.Object
-
- com.saperion.common.lang.format.UnlocalizedDateTimeFormat
-
public final class UnlocalizedDateTimeFormat extends java.lang.Object
UnlocalizedDateTimeFormat
is a utility class to convertDate
objects to an unlocalized, time-zone independent, character-set-independent string format and vice versa.This format is intended for file import/export and data transfer between systems as an independent data format.
This format is explicitly not to use for GUI-clients as they usually should attend localization, time-zone and so on.
The format is more or less like a
SimpleDateFormat
format of "Gyyyy-MM-dd HH:mm:ss.SSS" with an era of "-" for BC and none era for AD.This format is optimized this single format and for speed, so it is much faster than the
SimpleDateFormat
.An instance of this
UnlocalizedDateTimeFormat
can be used in several threads concurrently.- Author:
- agz
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
format(java.util.Date date)
Formats the specifiedDate
to an unlocalized string.static java.util.Date
parse(java.lang.String unlocalizedString)
Parses the specified unlocalized string to aDate
.
-
-
-
Method Detail
-
format
public static java.lang.String format(java.util.Date date)
Formats the specifiedDate
to an unlocalized string. The specifiedDate
must not benull
.- Parameters:
date
-Date
to format- Returns:
- unlocalized string
- See Also:
parse(String)
-
parse
public static java.util.Date parse(java.lang.String unlocalizedString) throws java.text.ParseException
Parses the specified unlocalized string to aDate
. The specified unlocalized string must not benull
.- Parameters:
unlocalizedString
- unlocalized string to parse- Returns:
Date
- Throws:
java.text.ParseException
- if the specified string is invalid- See Also:
format(Date)
-
-