tango.text.locale.Core

License:

BSD style: see license.txt

Version:

Initial release: 2005

Author:

John Chapman

Contains classes that provide information about locales, such as the language and calendars, as well as cultural conventions used for formatting dates, currency and numbers. Use these classes when writing applications for an international audience.

Interface Description
IFormatService Retrieves an object to control formatting.

Class Description
Calendar Represents time in week, month and year divisions.
Culture Provides information about a culture, such as its name, calendar and date and number format patterns.
DateTimeFormat Determines how Time values are formatted, depending on the culture.
DaylightSavingTime Represents a period of daylight-saving time.
Gregorian Represents the Gregorian calendar.
Hebrew Represents the Hebrew calendar.
Hijri Represents the Hijri calendar.
Japanese Represents the Japanese calendar.
Korean Represents the Korean calendar.
NumberFormat Determines how numbers are formatted, according to the current culture.
Region Provides information about a region.
Taiwan Represents the Taiwan calendar.
ThaiBuddhist Represents the Thai Buddhist calendar.

Struct Description
Time Represents time expressed as a date and time of day.
TimeSpan Represents a time interval.
enum CultureTypes [public] #
Defines the types of cultures that can be retrieved from Culture.getCultures.
Neutral #
Refers to cultures that are associated with a language but not specific to a country or region.
Specific #
Refers to cultures that are specific to a country or region.
All #
Refers to all cultures.
interface IFormatService(T) [public] #
Retrieves an object to control formatting. A class implements getFormat to retrieve an object that provides format information for the implementing type.

Remarks:

IFormatService is implemented by Culture, NumberFormat and DateTimeFormat to provide locale-specific formatting of numbers and date and time values.
Object getFormat(TypeInfo type) #
Retrieves an object that supports formatting for the specified _type.

Returns:

The current instance if type is the same _type as the current instance; otherwise, null.

Params:

typeAn object that specifies the _type of formatting to retrieve.
class Culture : IFormatService [public] #
Provides information about a culture, such as its name, calendar and date and number format patterns.

Remarks:

tango.text.locale adopts the RFC 1766 standard for culture names in the format <language>"-"<region>. <language> is a lower-case two-letter code defined by ISO 639-1. <region> is an upper-case two-letter code defined by ISO 3166. For example, "en-GB" is UK English.

There are three types of culture: invariant, neutral and specific. The invariant culture is not tied to any specific region, although it is associated with the English language. A neutral culture is associated with a language, but not with a region. A specific culture is associated with a language and a region. "es" is a neutral culture. "es-MX" is a specific culture.

Instances of DateTimeFormat and NumberFormat cannot be created for neutral cultures.

Examples:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import tango.io.Stdout, tango.text.locale.Core;

void main() {
  Culture culture = new Culture("it-IT");

  Stdout.formatln("englishName: {}", culture.englishName);
  Stdout.formatln("nativeName: {}", culture.nativeName);
  Stdout.formatln("name: {}", culture.name);
  Stdout.formatln("parent: {}", culture.parent.name);
  Stdout.formatln("isNeutral: {}", culture.isNeutral);
}

// Produces the following output:
// englishName: Italian (Italy)
// nativeName: italiano (Italia)
// name: it-IT
// parent: it
// isNeutral: false
this(char[] cultureName) [public] #
Initializes a new Culture instance from the supplied name.

Params:

cultureNameThe name of the Culture.
this(int cultureID) [public] #
Initializes a new Culture instance from the supplied culture identifier.

Params:

cultureIDThe identifer (LCID) of the Culture.

Remarks:

Culture identifiers correspond to a Windows LCID.
Object getFormat(TypeInfo type) [public] #
Retrieves an object defining how to format the specified type.

Params:

typeThe TypeInfo of the resulting formatting object.

Returns:

If type is typeid(NumberFormat), the value of the numberFormat property. If type is typeid(DateTimeFormat), the value of the dateTimeFormat property. Otherwise, null.

Remarks:

Implements IFormatService.getFormat.
Culture getCulture(int cultureID) [public, static] #
Returns a read-only instance of a culture using the specified culture identifier.

Params:

cultureIDThe identifier of the culture.

Returns:

A read-only culture instance.

Remarks:

Instances returned by this method are cached.
Culture getCulture(char[] cultureName) [public, static] #
Returns a read-only instance of a culture using the specified culture name.

Params:

cultureNameThe name of the culture.

Returns:

A read-only culture instance.

Remarks:

Instances returned by this method are cached.
Culture getCultureFromIetfLanguageTag(char[] name) [public, static] #
Returns a read-only instance using the specified name, as defined by the RFC 3066 standard and maintained by the IETF.

Params:

nameThe name of the language.

Returns:

A read-only culture instance.
Culture[] getCultures(CultureTypes types) [public, static] #
Returns a list of cultures filtered by the specified CultureTypes.

Params:

typesA combination of CultureTypes.

Returns:

An array of Culture instances containing cultures specified by types.
char[] toString() [public, override] #
Returns the name of the Culture.

Returns:

A string containing the name of the Culture in the format <language>"-"<region>.
Culture current() [public, static] #
Property. Retrieves the culture of the current user.

Returns:

The Culture instance representing the user's current culture.
void current(Culture value) [public, static] #
Property. Assigns the culture of the _current user.

Params:

valueThe Culture instance representing the user's _current culture.

Examples:

The following examples shows how to change the _current culture.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import tango.io.Print, tango.text.locale.Common;

void main() {
  // Displays the name of the current culture.
  Println("The current culture is %s.", Culture.current.englishName);

  // Changes the current culture to el-GR.
  Culture.current = new Culture("el-GR");
  Println("The current culture is now %s.", Culture.current.englishName);
}

// Produces the following output:
// The current culture is English (United Kingdom).
// The current culture is now Greek (Greece).
Culture invariantCulture() [public, static] #
Property. Retrieves the invariant Culture.

Returns:

The Culture instance that is invariant.

Remarks:

The invariant culture is culture-independent. It is not tied to any specific region, but is associated with the English language.
int id() [public] #
Property. Retrieves the identifier of the Culture.

Returns:

The culture identifier of the current instance.

Remarks:

The culture identifier corresponds to the Windows locale identifier (LCID). It can therefore be used when interfacing with the Windows NLS functions.
char[] name() [public] #
Property. Retrieves the name of the Culture in the format <language>"-"<region>.

Returns:

The name of the current instance. For example, the name of the UK English culture is "en-GB".
char[] englishName() [public] #
Property. Retrieves the name of the Culture in the format <languagename> (<regionname>) in English.

Returns:

The name of the current instance in English. For example, the englishName of the UK English culture is "English (United Kingdom)".
char[] nativeName() [public] #
Property. Retrieves the name of the Culture in the format <languagename> (<regionname>) in its native language.

Returns:

The name of the current instance in its native language. For example, if Culture.name is "de-DE", nativeName is "Deutsch (Deutschland)".
char[] twoLetterLanguageName() [public] #
Property. Retrieves the two-letter language code of the culture.

Returns:

The two-letter language code of the Culture instance. For example, the twoLetterLanguageName for English is "en".
char[] threeLetterLanguageName() [public] #
Property. Retrieves the three-letter language code of the culture.

Returns:

The three-letter language code of the Culture instance. For example, the threeLetterLanguageName for English is "eng".
char[] ietfLanguageTag() [public, final] #
Property. Retrieves the RFC 3066 identification for a language.

Returns:

A string representing the RFC 3066 language identification.
Culture parent() [public] #
Property. Retrieves the Culture representing the parent of the current instance.

Returns:

The Culture representing the parent of the current instance.
bool isNeutral() [public] #
Property. Retrieves a value indicating whether the current instance is a neutral culture.

Returns:

true is the current Culture represents a neutral culture; otherwise, false.

Examples:

The following example displays which cultures using Chinese are neutral.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import tango.io.Print, tango.text.locale.Common;

void main() {
  foreach (c; Culture.getCultures(CultureTypes.All)) {
    if (c.twoLetterLanguageName == "zh") {
      Print(c.englishName);
      if (c.isNeutral)
        Println("neutral");
      else
        Println("specific");
    }
  }
}

// Produces the following output:
// Chinese (Simplified) - neutral
// Chinese (Taiwan) - specific
// Chinese (People's Republic of China) - specific
// Chinese (Hong Kong S.A.R.) - specific
// Chinese (Singapore) - specific
// Chinese (Macao S.A.R.) - specific
// Chinese (Traditional) - neutral
bool isReadOnly() [public, final] #
Property. Retrieves a value indicating whether the instance is read-only.

Returns:

true if the instance is read-only; otherwise, false.

Remarks:

If the culture is read-only, the dateTimeFormat and numberFormat properties return read-only instances.
Calendar calendar() [public] #
Property. Retrieves the calendar used by the culture.

Returns:

A Calendar instance respresenting the calendar used by the culture.
Calendar[] optionalCalendars() [public] #
Property. Retrieves the list of calendars that can be used by the culture.

Returns:

An array of type Calendar representing the calendars that can be used by the culture.
NumberFormat numberFormat() [public] #
Property. Retrieves a NumberFormat defining the culturally appropriate format for displaying numbers and currency.

Returns:

A NumberFormat defining the culturally appropriate format for displaying numbers and currency.
void numberFormat(NumberFormat value) [public] #
Property. Assigns a NumberFormat defining the culturally appropriate format for displaying numbers and currency.

Params:

valuesA NumberFormat defining the culturally appropriate format for displaying numbers and currency.
DateTimeFormat dateTimeFormat() [public] #
Property. Retrieves a DateTimeFormat defining the culturally appropriate format for displaying dates and times.

Returns:

A DateTimeFormat defining the culturally appropriate format for displaying dates and times.
void dateTimeFormat(DateTimeFormat value) [public] #
Property. Assigns a DateTimeFormat defining the culturally appropriate format for displaying dates and times.

Params:

valuesA DateTimeFormat defining the culturally appropriate format for displaying dates and times.
class Region [public] #
Provides information about a region.

Remarks:

Region does not represent user preferences. It does not depend on the user's language or culture.

Examples:

The following example displays some of the properties of the Region class:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import tango.io.Print, tango.text.locale.Common;

void main() {
  Region region = new Region("en-GB");
  Println("name:              %s", region.name);
  Println("englishName:       %s", region.englishName);
  Println("isMetric:          %s", region.isMetric);
  Println("currencySymbol:    %s", region.currencySymbol);
  Println("isoCurrencySymbol: %s", region.isoCurrencySymbol);
}

// Produces the following output.
// name:              en-GB
// englishName:       United Kingdom
// isMetric:          true
// currencySymbol:    £
// isoCurrencySymbol: GBP
this(int cultureID) [public] #
Initializes a new Region instance based on the region associated with the specified culture identifier.

Params:

cultureIDA culture indentifier.

Remarks:

The name of the Region instance is set to the ISO 3166 two-letter code for that region.
this(char[] name) [public] #
Initializes a new Region instance based on the region specified by name.

Params:

nameA two-letter ISO 3166 code for the region. Or, a culture _name consisting of the language and region.
Region current() [public, static] #
Property. Retrieves the Region used by the current Culture.

Returns:

The Region instance associated with the current Culture.
int geoID() [public] #
Property. Retrieves a unique identifier for the geographical location of the region.

Returns:

An int uniquely identifying the geographical location.
char[] name() [public] #
Property. Retrieves the ISO 3166 code, or the name, of the current Region.

Returns:

The value specified by the name parameter of the Region(char[]) constructor.
char[] englishName() [public] #
Property. Retrieves the full name of the region in English.

Returns:

The full name of the region in English.
char[] nativeName() [public] #
Property. Retrieves the full name of the region in its native language.

Returns:

The full name of the region in the language associated with the region code.
char[] twoLetterRegionName() [public] #
Property. Retrieves the two-letter ISO 3166 code of the region.

Returns:

The two-letter ISO 3166 code of the region.
char[] threeLetterRegionName() [public] #
Property. Retrieves the three-letter ISO 3166 code of the region.

Returns:

The three-letter ISO 3166 code of the region.
char[] currencySymbol() [public] #
Property. Retrieves the currency symbol of the region.

Returns:

The currency symbol of the region.
char[] isoCurrencySymbol() [public] #
Property. Retrieves the three-character currency symbol of the region.

Returns:

The three-character currency symbol of the region.
char[] currencyEnglishName() [public] #
Property. Retrieves the name in English of the currency used in the region.

Returns:

The name in English of the currency used in the region.
char[] currencyNativeName() [public] #
Property. Retrieves the name in the native language of the region of the currency used in the region.

Returns:

The name in the native language of the region of the currency used in the region.
bool isMetric() [public] #
Property. Retrieves a value indicating whether the region uses the metric system for measurements.

Returns:

true is the region uses the metric system; otherwise, false.
char[] toString() [public, override] #
Returns a string containing the ISO 3166 code, or the name, of the current Region.

Returns:

A string containing the ISO 3166 code, or the name, of the current Region.
class NumberFormat : IFormatService [public] #
Determines how numbers are formatted, according to the current culture.

Remarks:

Numbers are formatted using format patterns retrieved from a NumberFormat instance. This class implements IFormatService.getFormat.

Examples:

The following example shows how to retrieve an instance of NumberFormat for a Culture and use it to display number formatting information.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import tango.io.Print, tango.text.locale.Common;

void main(char[][] args) {
  foreach (c; Culture.getCultures(CultureTypes.Specific)) {
    if (c.twoLetterLanguageName == "en") {
      NumberFormat fmt = c.numberFormat;
      Println("The currency symbol for %s is '%s'", 
        c.englishName, 
        fmt.currencySymbol);
    }
  }
}

// Produces the following output:
// The currency symbol for English (United States) is '$'
// The currency symbol for English (United Kingdom) is '£'
// The currency symbol for English (Australia) is '$'
// The currency symbol for English (Canada) is '$'
// The currency symbol for English (New Zealand) is '$'
// The currency symbol for English (Ireland) is '€'
// The currency symbol for English (South Africa) is 'R'
// The currency symbol for English (Jamaica) is 'J$'
// The currency symbol for English (Caribbean) is '$'
// The currency symbol for English (Belize) is 'BZ$'
// The currency symbol for English (Trinidad and Tobago) is 'TT$'
// The currency symbol for English (Zimbabwe) is 'Z$'
// The currency symbol for English (Republic of the Philippines) is 'Php'
this() [public] #
Initializes a new, culturally independent instance.

Remarks:

Modify the properties of the new instance to define custom formatting.
Object getFormat(TypeInfo type) [public] #
Retrieves an object defining how to format the specified type.

Params:

typeThe TypeInfo of the resulting formatting object.

Returns:

If type is typeid(NumberFormat), the current NumberFormat instance. Otherwise, null.

Remarks:

Implements IFormatService.getFormat.
NumberFormat getInstance(IFormatService formatService) [public, static] #
Retrieves the NumberFormat for the specified IFormatService.

Params:

formatServiceThe IFormatService used to retrieve NumberFormat.

Returns:

The NumberFormat for the specified IFormatService.

Remarks:

The method calls IFormatService.getFormat with typeof(NumberFormat). If formatService is null, then the value of the current property is returned.
NumberFormat current() [public, static] #
Property. Retrieves a read-only NumberFormat instance from the current culture.

Returns:

A read-only NumberFormat instance from the current culture.
NumberFormat invariantFormat() [public, static] #
Property. Retrieves the read-only, culturally independent NumberFormat instance.

Returns:

The read-only, culturally independent NumberFormat instance.
bool isReadOnly() [public, final] #
Property. Retrieves a value indicating whether the instance is read-only.

Returns:

true if the instance is read-only; otherwise, false.
int numberDecimalDigits() [public, final] #
Property. Retrieves the number of decimal places used for numbers.

Returns:

The number of decimal places used for numbers. For invariantFormat, the default is 2.
void numberDecimalDigits(int value) [public, final] #
Assigns the number of decimal digits used for numbers.

Params:

valueThe number of decimal places used for numbers.

Throws:

Exception if the property is being set and the instance is read-only.

Examples:

The following example shows the effect of changing numberDecimalDigits.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import tango.io.Print, tango.text.locale.Common;

void main() {
  // Get the NumberFormat from the en-GB culture.
  NumberFormat fmt = (new Culture("en-GB")).numberFormat;

  // Display a value with the default number of decimal digits.
  int n = 5678;
  Println(Formatter.format(fmt, "{0:N}", n));

  // Display the value with six decimal digits.
  fmt.numberDecimalDigits = 6;
  Println(Formatter.format(fmt, "{0:N}", n));
}

// Produces the following output:
// 5,678.00
// 5,678.000000
int numberNegativePattern() [public, final] #
Property. Retrieves the format pattern for negative numbers.

Returns:

The format pattern for negative numbers. For invariantFormat, the default is 1 (representing "-n").

Remarks:

The following table shows valid values for this property.

ValuePattern
0(n)
1-n
2- n
3n-
4n -
void numberNegativePattern(int value) [public, final] #
Property. Assigns the format pattern for negative numbers.

Params:

valueThe format pattern for negative numbers.

Examples:

The following example shows the effect of the different patterns.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import tango.io.Print, tango.text.locale.Common;

void main() {
  NumberFormat fmt = new NumberFormat;
  int n = -5678;

  // Display the default pattern.
  Println(Formatter.format(fmt, "{0:N}", n));

  // Display all patterns.
  for (int i = 0; i <= 4; i++) {
    fmt.numberNegativePattern = i;
    Println(Formatter.format(fmt, "{0:N}", n));
  }
}

// Produces the following output:
// (5,678.00)
// (5,678.00)
// -5,678.00
// - 5,678.00
// 5,678.00-
// 5,678.00 -
int currencyDecimalDigits() [public, final] #
Property. Retrieves the number of decimal places to use in currency values.

Returns:

The number of decimal digits to use in currency values.
void currencyDecimalDigits(int value) [public, final] #
Property. Assigns the number of decimal places to use in currency values.

Params:

valueThe number of decimal digits to use in currency values.
int currencyNegativePattern() [public, final] #
Property. Retrieves the formal pattern to use for negative currency values.

Returns:

The format pattern to use for negative currency values.
void currencyNegativePattern(int value) [public, final] #
Property. Assigns the formal pattern to use for negative currency values.

Params:

valueThe format pattern to use for negative currency values.
int currencyPositivePattern() [public, final] #
Property. Retrieves the formal pattern to use for positive currency values.

Returns:

The format pattern to use for positive currency values.
void currencyPositivePattern(int value) [public, final] #
Property. Assigns the formal pattern to use for positive currency values.

Returns:

The format pattern to use for positive currency values.
int[] numberGroupSizes() [public, final] #
Property. Retrieves the number of digits int each group to the left of the decimal place in numbers.

Returns:

The number of digits int each group to the left of the decimal place in numbers.
void numberGroupSizes(int[] value) [public, final] #
Property. Assigns the number of digits int each group to the left of the decimal place in numbers.

Params:

valueThe number of digits int each group to the left of the decimal place in numbers.
int[] currencyGroupSizes() [public, final] #
Property. Retrieves the number of digits int each group to the left of the decimal place in currency values.

Returns:

The number of digits int each group to the left of the decimal place in currency values.
void currencyGroupSizes(int[] value) [public, final] #
Property. Assigns the number of digits int each group to the left of the decimal place in currency values.

Params:

valueThe number of digits int each group to the left of the decimal place in currency values.
char[] numberGroupSeparator() [public, final] #
Property. Retrieves the string separating groups of digits to the left of the decimal place in numbers.

Returns:

The string separating groups of digits to the left of the decimal place in numbers. For example, ",".
void numberGroupSeparator(char[] value) [public, final] #
Property. Assigns the string separating groups of digits to the left of the decimal place in numbers.

Params:

valueThe string separating groups of digits to the left of the decimal place in numbers.
char[] numberDecimalSeparator() [public, final] #
Property. Retrieves the string used as the decimal separator in numbers.

Returns:

The string used as the decimal separator in numbers. For example, ".".
void numberDecimalSeparator(char[] value) [public, final] #
Property. Assigns the string used as the decimal separator in numbers.

Params:

valueThe string used as the decimal separator in numbers.
char[] currencyGroupSeparator() [public, final] #
Property. Retrieves the string separating groups of digits to the left of the decimal place in currency values.

Returns:

The string separating groups of digits to the left of the decimal place in currency values. For example, ",".
void currencyGroupSeparator(char[] value) [public, final] #
Property. Assigns the string separating groups of digits to the left of the decimal place in currency values.

Params:

valueThe string separating groups of digits to the left of the decimal place in currency values.
char[] currencyDecimalSeparator() [public, final] #
Property. Retrieves the string used as the decimal separator in currency values.

Returns:

The string used as the decimal separator in currency values. For example, ".".
void currencyDecimalSeparator(char[] value) [public, final] #
Property. Assigns the string used as the decimal separator in currency values.

Params:

valueThe string used as the decimal separator in currency values.
char[] currencySymbol() [public, final] #
Property. Retrieves the string used as the currency symbol.

Returns:

The string used as the currency symbol. For example, "£".
void currencySymbol(char[] value) [public, final] #
Property. Assigns the string used as the currency symbol.

Params:

valueThe string used as the currency symbol.
char[] negativeSign() [public, final] #
Property. Retrieves the string denoting that a number is negative.

Returns:

The string denoting that a number is negative. For example, "-".
void negativeSign(char[] value) [public, final] #
Property. Assigns the string denoting that a number is negative.

Params:

valueThe string denoting that a number is negative.
char[] positiveSign() [public, final] #
Property. Retrieves the string denoting that a number is positive.

Returns:

The string denoting that a number is positive. For example, "+".
void positiveSign(char[] value) [public, final] #
Property. Assigns the string denoting that a number is positive.

Params:

valueThe string denoting that a number is positive.
char[] nanSymbol() [public, final] #
Property. Retrieves the string representing the NaN (not a number) value.

Returns:

The string representing the NaN value. For example, "NaN".
void nanSymbol(char[] value) [public, final] #
Property. Assigns the string representing the NaN (not a number) value.

Params:

valueThe string representing the NaN value.
char[] negativeInfinitySymbol() [public, final] #
Property. Retrieves the string representing negative infinity.

Returns:

The string representing negative infinity. For example, "-Infinity".
void negativeInfinitySymbol(char[] value) [public, final] #
Property. Assigns the string representing negative infinity.

Params:

valueThe string representing negative infinity.
char[] positiveInfinitySymbol() [public, final] #
Property. Retrieves the string representing positive infinity.

Returns:

The string representing positive infinity. For example, "Infinity".
void positiveInfinitySymbol(char[] value) [public, final] #
Property. Assigns the string representing positive infinity.

Params:

valueThe string representing positive infinity.
char[][] nativeDigits() [public, final] #
Property. Retrieves a string array of native equivalents of the digits 0 to 9.

Returns:

A string array of native equivalents of the digits 0 to 9.
void nativeDigits(char[][] value) [public, final] #
Property. Assigns a string array of native equivalents of the digits 0 to 9.

Params:

valueA string array of native equivalents of the digits 0 to 9.
class DateTimeFormat : IFormatService [public] #
Determines how Time values are formatted, depending on the culture.

Remarks:

To create a DateTimeFormat for a specific culture, create a Culture for that culture and retrieve its dateTimeFormat property. To create a DateTimeFormat for the user's current culture, use the current property.
this() [package] #
Initializes an instance that is writable and culture-independent.
Object getFormat(TypeInfo type) [public] #
Retrieves an object defining how to format the specified type.

Params:

typeThe TypeInfo of the resulting formatting object.

Returns:

If type is typeid(DateTimeFormat), the current DateTimeFormat instance. Otherwise, null.

Remarks:

Implements IFormatService.getFormat.
char[][] getAllDateTimePatterns() [public, final] #
Retrieves the standard patterns in which Time values can be formatted.

Returns:

An array of strings containing the standard patterns in which Time values can be formatted.
char[][] getAllDateTimePatterns(char format) [public, final] #
Retrieves the standard patterns in which Time values can be formatted using the specified format character.

Returns:

An array of strings containing the standard patterns in which Time values can be formatted using the specified format character.
char[] getAbbreviatedDayName(Calendar.DayOfWeek dayOfWeek) [public, final] #
Retrieves the abbreviated name of the specified day of the week based on the culture of the instance.

Params:

dayOfWeekA DayOfWeek value.

Returns:

The abbreviated name of the day of the week represented by dayOfWeek.
char[] getDayName(Calendar.DayOfWeek dayOfWeek) [public, final] #
Retrieves the full name of the specified day of the week based on the culture of the instance.

Params:

dayOfWeekA DayOfWeek value.

Returns:

The full name of the day of the week represented by dayOfWeek.
char[] getAbbreviatedMonthName(int month) [public, final] #
Retrieves the abbreviated name of the specified month based on the culture of the instance.

Params:

monthAn integer between 1 and 13 indicating the name of the _month to return.

Returns:

The abbreviated name of the _month represented by month.
char[] getMonthName(int month) [public, final] #
Retrieves the full name of the specified month based on the culture of the instance.

Params:

monthAn integer between 1 and 13 indicating the name of the _month to return.

Returns:

The full name of the _month represented by month.
DateTimeFormat getInstance(IFormatService formatService) [public, static] #
Retrieves the DateTimeFormat for the specified IFormatService.

Params:

formatServiceThe IFormatService used to retrieve DateTimeFormat.

Returns:

The DateTimeFormat for the specified IFormatService.

Remarks:

The method calls IFormatService.getFormat with typeof(DateTimeFormat). If formatService is null, then the value of the current property is returned.
DateTimeFormat current() [public, static] #
Property. Retrieves a read-only DateTimeFormat instance from the current culture.

Returns:

A read-only DateTimeFormat instance from the current culture.
DateTimeFormat invariantFormat() [public, static] #
Property. Retrieves a read-only DateTimeFormat instance that is culturally independent.

Returns:

A read-only DateTimeFormat instance that is culturally independent.
bool isReadOnly() [public, final] #
Property. Retrieves a value indicating whether the instance is read-only.

Returns:

true is the instance is read-only; otherwise, false.
Calendar calendar() [public, final] #
Property. Retrieves the calendar used by the current culture.

Returns:

The Calendar determining the calendar used by the current culture. For example, the Gregorian.
void calendar(Calendar value) [public, final] #
Property. Assigns the calendar to be used by the current culture.

Params:

valueThe Calendar determining the calendar to be used by the current culture.

Exceptions:

If value is not valid for the current culture, an Exception is thrown.
Calendar.DayOfWeek firstDayOfWeek() [public, final] #
Property. Retrieves the first day of the week.

Returns:

A DayOfWeek value indicating the first day of the week.
void firstDayOfWeek(Calendar.DayOfWeek value) [public, final] #
Property. Assigns the first day of the week.

Params:

valieA DayOfWeek value indicating the first day of the week.
Calendar.WeekRule calendarWeekRule() [public, final] #
Property. Retrieves the _value indicating the rule used to determine the first week of the year.

Returns:

A CalendarWeekRule _value determining the first week of the year.
void calendarWeekRule(Calendar.WeekRule value) [public, final] #
Property. Assigns the _value indicating the rule used to determine the first week of the year.

Params:

valueA CalendarWeekRule _value determining the first week of the year.
char[] nativeCalendarName() [public, final] #
Property. Retrieves the native name of the calendar associated with the current instance.

Returns:

The native name of the calendar associated with the current instance.
char[] dateSeparator() [public, final] #
Property. Retrieves the string separating date components.

Returns:

The string separating date components.
void dateSeparator(char[] value) [public, final] #
Property. Assigns the string separating date components.

Params:

valueThe string separating date components.
char[] timeSeparator() [public, final] #
Property. Retrieves the string separating time components.

Returns:

The string separating time components.
void timeSeparator(char[] value) [public, final] #
Property. Assigns the string separating time components.

Params:

valueThe string separating time components.
char[] amDesignator() [public, final] #
Property. Retrieves the string designator for hours before noon.

Returns:

The string designator for hours before noon. For example, "AM".
void amDesignator(char[] value) [public, final] #
Property. Assigns the string designator for hours before noon.

Params:

valueThe string designator for hours before noon.
char[] pmDesignator() [public, final] #
Property. Retrieves the string designator for hours after noon.

Returns:

The string designator for hours after noon. For example, "PM".
void pmDesignator(char[] value) [public, final] #
Property. Assigns the string designator for hours after noon.

Params:

valueThe string designator for hours after noon.
char[] shortDatePattern() [public, final] #
Property. Retrieves the format pattern for a short date value.

Returns:

The format pattern for a short date value.
void shortDatePattern(char[] value) [public, final] #
Property. Assigns the format pattern for a short date _value.

Params:

valueThe format pattern for a short date _value.
char[] shortTimePattern() [public, final] #
Property. Retrieves the format pattern for a short time value.

Returns:

The format pattern for a short time value.
void shortTimePattern(char[] value) [public, final] #
Property. Assigns the format pattern for a short time _value.

Params:

valueThe format pattern for a short time _value.
char[] longDatePattern() [public, final] #
Property. Retrieves the format pattern for a long date value.

Returns:

The format pattern for a long date value.
void longDatePattern(char[] value) [public, final] #
Property. Assigns the format pattern for a long date _value.

Params:

valueThe format pattern for a long date _value.
char[] longTimePattern() [public, final] #
Property. Retrieves the format pattern for a long time value.

Returns:

The format pattern for a long time value.
void longTimePattern(char[] value) [public, final] #
Property. Assigns the format pattern for a long time _value.

Params:

valueThe format pattern for a long time _value.
char[] monthDayPattern() [public, final] #
Property. Retrieves the format pattern for a month and day value.

Returns:

The format pattern for a month and day value.
void monthDayPattern(char[] value) [public, final] #
Property. Assigns the format pattern for a month and day _value.

Params:

valueThe format pattern for a month and day _value.
char[] yearMonthPattern() [public, final] #
Property. Retrieves the format pattern for a year and month value.

Returns:

The format pattern for a year and month value.
void yearMonthPattern(char[] value) [public, final] #
Property. Assigns the format pattern for a year and month _value.

Params:

valueThe format pattern for a year and month _value.
char[][] abbreviatedDayNames() [public, final] #
Property. Retrieves a string array containing the abbreviated names of the days of the week.

Returns:

A string array containing the abbreviated names of the days of the week. For invariantFormat, this contains "Sun", "Mon", "Tue", "Wed", "Thu", "Fri" and "Sat".
void abbreviatedDayNames(char[][] value) [public, final] #
Property. Assigns a string array containing the abbreviated names of the days of the week.

Params:

valueA string array containing the abbreviated names of the days of the week.
char[][] dayNames() [public, final] #
Property. Retrieves a string array containing the full names of the days of the week.

Returns:

A string array containing the full names of the days of the week. For invariantFormat, this contains "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" and "Saturday".
void dayNames(char[][] value) [public, final] #
Property. Assigns a string array containing the full names of the days of the week.

Params:

valueA string array containing the full names of the days of the week.
char[][] abbreviatedMonthNames() [public, final] #
Property. Retrieves a string array containing the abbreviated names of the months.

Returns:

A string array containing the abbreviated names of the months. For invariantFormat, this contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" and "".
void abbreviatedMonthNames(char[][] value) [public, final] #
Property. Assigns a string array containing the abbreviated names of the months.

Params:

valueA string array containing the abbreviated names of the months.
char[][] monthNames() [public, final] #
Property. Retrieves a string array containing the full names of the months.

Returns:

A string array containing the full names of the months. For invariantFormat, this contains "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" and "".
void monthNames(char[][] value) [public, final] #
Property. Assigns a string array containing the full names of the months.

Params:

valueA string array containing the full names of the months.
char[] fullDateTimePattern() [public, final] #
Property. Retrieves the format pattern for a long date and a long time value.

Returns:

The format pattern for a long date and a long time value.
void fullDateTimePattern(char[] value) [public, final] #
Property. Assigns the format pattern for a long date and a long time _value.

Params:

valueThe format pattern for a long date and a long time _value.
char[] rfc1123Pattern() [public, final] #
Property. Retrieves the format pattern based on the IETF RFC 1123 specification, for a time value.

Returns:

The format pattern based on the IETF RFC 1123 specification, for a time value.
char[] sortableDateTimePattern() [public, final] #
Property. Retrieves the format pattern for a sortable date and time value.

Returns:

The format pattern for a sortable date and time value.
char[] universalSortableDateTimePattern() [public, final] #
Property. Retrieves the format pattern for a universal date and time value.

Returns:

The format pattern for a universal date and time value.