Class DateFormatting
java.lang.Object
com.vmware.vipclient.i18n.base.instances.DateFormatting
- All Implemented Interfaces:
Formatting,I18n
Provide some functions to get formatted date/time string.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatDate(Object obj, String pattern, String timeZone, Locale locale) Get the formatted string of specified time zone in specified pattern and specified Locale.formatDate(Object obj, String pattern, Locale locale) Get the formatted string of default time zone in specified pattern and specified Locale.
-
Constructor Details
-
DateFormatting
public DateFormatting()
-
-
Method Details
-
formatDate
Get the formatted string of default time zone in specified pattern and specified Locale.- Parameters:
obj- The object which represents date, it can be Date, Calendar, timestamp in long, or ISO string. For ISO string, please refer to https://www.w3.org/TR/NOTE-datetime.pattern- The format you want the date string show in. Currently VIP supports 12 formats, they are full, long, medium, short, fullDate, longDate, mediumDate, shortDate, fullTime, longTime, mediumTime, shortTime. The first four formats combine date and time together. For the real pattern each format representslocale- The locale for which the date format is desired.- Returns:
- The formatted date/time string.
-
formatDate
Get the formatted string of specified time zone in specified pattern and specified Locale.- Parameters:
obj- The object which represents date, it can be Date, Calendar, timestamp in long, or ISO string. For ISO string, please refer to https://www.w3.org/TR/NOTE-datetime.pattern- The format you want the date string show in. Currently VIP supports 12 formats, they are full, long, medium, short, fullDate, longDate, mediumDate, shortDate, fullTime, longTime, mediumTime, shortTime. The first four formats combine date and time together. For the real pattern each format representstimeZone- The ID for a TimeZone, such as "America/Los_Angeles", or a custom ID such as "GMT-8:00".locale- The locale for which the date format is desired.- Returns:
- The formatted date/time string.
-
formatDate
-