Android Date and time format internationalization

Source: Internet
Author: User
Tags dateformat

public class
The DateFormatSymbols
Extension objects
Implementing the Serializable Interface Cloneable interface
Java.lang.Object's
? java.text.DateFormatSymbols
class overview

Encapsulates this information with localized datetime format data, such as months of names, names of Sunday, and time zone data for DateFormat and SimpleDateFormat that are used by DateFormatSymbols.

Normally, you should not be able to use the dateformatsymbols directly. Instead, we encourage you to create a factory method for a date/time formatted DateFormat class: Gettimeinstance,getdateinstance, or getdatetimeinstance. These methods automatically create DateFormatSymbols formatting so that you do not have to. After you create a format, you can modify its format by using the Setpattern method of the pattern. For more information on how to create a factory method for formatting used DateFormat, see DateFormat.

Because execution does not make the assumption of about user-supplied/user-modifiable data the same degree, the direct use of dateformatsymbols is likely to be inefficient, and it can be built with its own data.

See

The DateFormat
SimpleDateFormat's
Summarize

Public constructors
The DateFormatSymbols ()
Constructs a new DateFormatSymbols instance that contains the symbols for the user's default locale.
The DateFormatSymbols (locale locale)
Constructs a new DateFormatSymbols instance that contains the symbols for the specified locale.
Public methods
Object Cloning ()
Creates and returns this replica object.
Boolean equals (Object object)
Compares the specified object with this object, and represents if they are equal.
The string []getampmstrings ()
Returns an array of strings representing the morning and afternoon.
static site []getavailablelocales ()
Returns an DateFormatSymbols instance of an array for the custom locale.
The string []geteras ()
Returns an array of strings representing BC and AD.
The last static dateformatsymbols of the getinstance ()
Returns an instance of the default locale for a new DateFormatSymbols user.
GetInstance of the last static dateformatsymbols (locale locale)
Returns a new dateformatsymbols for the given locale.
String Getlocalpatternchars ()
Returns the specified date and Time field for the character SimpleDateFormat used by the mode.
The string []getmonths ()
Returns a string array that contains the full name of the month.
The string []getshortmonths ()
Returns an array of strings that contain abbreviated names for months.
The string []getshortweekdays ()
Returns an array of strings that contain abbreviated names for the day of the week.
The string []getweekdays ()
Returns a string array that contains the full name of the number of days of the week.
string [] []getzonestrings ()
Returns a two-dimensional array that contains a string of localized names for the time zone.
Hashcode of Int ()
Returns an integer hash code for this object.
Invalid Setampmstrings (string [] data)
Sets an array of strings representing the morning and afternoon.
Invalid Seteras (string [] data)
Sets an array of strings representing BC and AD.
Invalid Setlocalpatternchars (string data)
Sets the specified date and Time field for the character SimpleDateFormat used in the pattern.
Invalid Setmonths (string [] data)
Sets a string array that contains the full name of the month.
Invalid Setshortmonths (string [] data)
Sets a string array that contains abbreviated names for months.
Invalid Setshortweekdays (string [] data)
Sets an array of strings that contain abbreviated names for the day of the week.
Invalid Setweekdays (string [] data)
Sets a string array that contains the full name of the days of the week.
Invalid Setzonestrings (string [] [] zonestrings)
Sets a two-dimensional array that contains a string of localized names for the time zone.
The ToString of the string ()
Returns a string that contains one of this object's?? Concise, human-readable description.
Expand
Methods of inheritance
Inheriting from class Java.lang.Object
Public constructors

DateFormatSymbols of the public ()

Date: API Level 1
Constructs a new DateFormatSymbols instance that contains the symbols for the user's default locale. See "Alert default Locales".
DateFormatSymbols of the public (locale locale)

Date: API Level 1
Constructs a new DateFormatSymbols instance that contains the symbols for the specified locale.
Parameters

Locale language environment.
Public methods

Clone of public object ()

Date: API Level 1
Creates and returns this replica object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class, and then copies the field values (including object references) from this instance to the new instance. In contrast, a "deep" copy will also recursively clone nested objects. A subclass that needs to implement this clone should call Super.clone () to create a new instance, and then create a deep copy of the nested, mutable object.
Return

One of this object?? Copy.
public Boolean equals (Object object)

Date: API Level 1
Compares the specified object with this object, and represents if they are equal.
Parameters

Object that the object is compared to.
Return

True if the object is an instance of the DateFormatSymbols with the same symbol as this object, otherwise false.
See

Hashcode () method
Common string [] getampmstrings ()

Date: API Level 1
Returns an array of strings representing the morning and afternoon. Use the constants of the calendar calendar.am and calendar.pm arrays for metrics.
Return

An array of strings.
Common static language environment [] getavailablelocales ()

Date: API Level 9
Returns an DateFormatSymbols instance of an array for the custom locale.
Please note that Android does not support users providing a localization service provider.
The public string [of] Geteras ()

Date: API Level 1
Returns an array of strings representing BC and AD. Use the constants of the calendar GREGORIANCALENDAR.BC and gregoriancalendar.ad arrays for metrics.
Return

An array of strings.
public static last DateFormatSymbols of the getinstance ()

Date: API Level 9
Returns an instance of the default locale for a new DateFormatSymbols user. See "Alert default Locales".
Return

DateFormatSymbols of an instance
GetInstance of the public static final DateFormatSymbols (locale locale)

Date: API Level 9
Returns a new dateformatsymbols for the given locale.
Parameters

Locale language environment
Return

DateFormatSymbols of an instance
Thrown

NullPointerException exception if locale = = NULL
Common String Getlocalpatternchars ()

Date: API Level 1
Returns the specified date and Time field for the character SimpleDateFormat used by the mode.
Return

A string that contains the pattern character.
Common string [] getmonths ()

Date: API Level 1
Returns a string array that contains the full name of the month. Use the constant calendar.january of the calendar as an indicator of the array.
Return

An array of strings.
Common string [] getshortmonths ()

Date: API Level 1
Returns an array of strings that contain abbreviated names for months. Use the constant calendar.january of the calendar as an indicator of the array.
Return

An array of strings.
Common string [] getshortweekdays ()

Date: API Level 1
Returns an array of strings that contain abbreviated names for the day of the week. Use the "Calendar" constant calendar.sunday and so on. As an indicator of the array.
Return

An array of strings.
Common string [] getweekdays ()

Date: API Level 1
Returns a string array that contains the full name of the number of days of the week. Use the "Calendar" constant calendar.sunday and so on. As an indicator of the array.
Return

An array of strings.
The public string [] [] getzonestrings ()

Date: API Level 1
Returns a two-dimensional array that contains a string of localized names for the time zone. Each row is an array of five strings:
Time zone ID, such as "Americas/Los Angeles". This is not localized and is used to the key in the table.
Long-term display name, such as "Pacific Standard Time".
Short-term display name, such as "Pacific Standard Time".
The long-term DST display name, such as "Pacific Daylight Time". This is a non-DST long name for the zone, and has never had DST, such as "Central Standard Time", "Canada/Saskatchewan".
The display name of the short DST, for example "PDT". This is the short-term non-daylight-saving name area that has never been DST for example, "CST", "Canada/Saskatchewan".
Public interpretation of the hashcode ()

Date: API Level 1
Returns an integer hash code for this object. Contract, any two objects that are equal to (object) return true must return the same hash code value. This means that objects of subclasses, typically covering two methods, are neither methods.
Note that the hash value must not change over time, unless the information used is changed in the equals comparison.
See Write a correct hashcode method if you intend to implement your own Hashcode method.
Return

The hash code for this object.
Public invalid Setampmstrings (string [] data)

Date: API Level 1
Sets an array of strings representing the morning and afternoon. Use the constants of the calendar calendar.am and calendar.pm arrays for metrics.
Parameters

A string array of data morning and afternoon.
Public invalid Seteras (string [] data)

Date: API Level 1
Sets an array of strings representing BC and AD. Use the constants of the calendar GREGORIANCALENDAR.BC and gregoriancalendar.ad arrays for metrics.
Parameters

A string array of data BC and AD.
Public invalid Setlocalpatternchars (string data)

Date: API Level 1
Sets the specified date and Time field for the character SimpleDateFormat used in the pattern.
Parameters

The data contains a string of pattern characters.
Thrown

NullPointerException exception if the data is empty
Public invalid Setmonths (string [] data)

Date: API Level 1
Sets a string array that contains the full name of the month. Use the constant calendar.january of the calendar as an indicator of the array.
Parameters

An array of data strings.
Public invalid Setshortmonths (string [] data)

Date: API Level 1
Sets a string array that contains abbreviated names for months. Use the constant calendar.january of the calendar as an indicator of the array.
Parameters

An array of data strings.
Public invalid Setshortweekdays (string [] data)

Date: API Level 1
Sets an array of strings that contain abbreviated names for the day of the week. Use the "Calendar" constant calendar.sunday and so on. As an indicator of the array.
Parameters

An array of data strings.
Public invalid Setweekdays (string [] data)

Date: API Level 1
Sets a string array that contains the full name of the days of the week. Use the "Calendar" constant calendar.sunday and so on. As an indicator of the array.
Parameters

An array of data strings.
Public invalid Setzonestrings (string [] [] zonestrings)

Date: API Level 1
Sets a two-dimensional array that contains a string of localized names for the time zone. Details of the getzonestrings ().
Thrown

IllegalArgumentException If there are fewer than 5 elements of any line.
NullPointerException exception if zonestrings = = NULL.
ToString () of the public string

Date: API Level 1
Returns a string that contains one of this object's?? Concise, human-readable description. Subclasses are encouraged to override this method and provide the types and data that implement the objects that need to be considered. The default implementation is equivalent to the following expression:
The GetClass (). The getname () + ' @ ' + integer. Tohexstring's Hashcode ()
See Write a useful tostring method if you intend to implement your own ToString method.
Return

Android Date and time format internationalization

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.