Class UnlocalizedDateTimeFormat
- java.lang.Object
-
- com.saperion.common.lang.format.UnlocalizedDateTimeFormat
-
public final class UnlocalizedDateTimeFormat extends java.lang.ObjectUnlocalizedDateTimeFormatis a utility class to convertDateobjects 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
SimpleDateFormatformat 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
UnlocalizedDateTimeFormatcan be used in several threads concurrently.- Author:
- agz
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringformat(java.util.Date date)Formats the specifiedDateto an unlocalized string.static java.util.Dateparse(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 specifiedDateto an unlocalized string. The specifiedDatemust not benull.- Parameters:
date-Dateto format- Returns:
- unlocalized string
- See Also:
parse(String)
-
parse
public static java.util.Date parse(java.lang.String unlocalizedString) throws java.text.ParseExceptionParses 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)
-
-