tango.text.locale.Core

License:
BSD style:

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.









enum CultureTypes: int;
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;
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.

abstract 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:
TypeInfo type An object that specifies the type of formatting to retrieve.

class Culture: tango.text.locale.Core.IFormatService;
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:
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(const(char)[] cultureName);
Initializes a new Culture instance from the supplied name.

Params:
const(char)[] cultureName The name of the Culture.

this(int cultureID);
Initializes a new Culture instance from the supplied culture identifier.

Params:
int cultureID The identifer (LCID) of the Culture.

Remarks:
Culture identifiers correspond to a Windows LCID.

Object getFormat(TypeInfo type);
Retrieves an object defining how to format the specified type.

Params:
TypeInfo type The 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.

static Culture getCulture(int cultureID);
Returns a read-only instance of a culture using the specified culture identifier.

Params:
int cultureID The identifier of the culture.

Returns:
A read-only culture instance.

Remarks:
Instances returned by this method are cached.

static Culture getCulture(const(char)[] cultureName);
Returns a read-only instance of a culture using the specified culture name.

Params:
const(char)[] cultureName The name of the culture.

Returns:
A read-only culture instance.

Remarks:
Instances returned by this method are cached.

static Culture getCultureFromIetfLanguageTag(const(char)[] name);
Returns a read-only instance using the specified name, as defined by the RFC 3066 standard and maintained by the IETF.

Params:
const(char)[] name The name of the language.

Returns:
A read-only culture instance.

static Culture[] getCultures(CultureTypes types);
Returns a list of cultures filtered by the specified CultureTypes.

Params:
CultureTypes types A combination of CultureTypes.

Returns:
An array of Culture instances containing cultures specified by types.

immutable(char)[] toString();
Returns the name of the Culture.

Returns:
A string containing the name of the Culture in the format <language>"-"<region>.

static @property Culture current();
Property. Retrieves the culture of the current user.

Returns:
The Culture instance representing the user's current culture.

static @property void current(Culture value);
Property. Assigns the culture of the current user.

Params:
Culture value The Culture instance representing the user's current culture.

Examples:
The following examples shows how to change the current culture.
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).


static @property Culture invariantCulture();
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.

const @property int id();
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.

const @property const(char)[] name();
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".

const @property const(char)[] englishName();
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)".

const @property const(char)[] nativeName();
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)".

const @property const(char)[] twoLetterLanguageName();
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".

const @property const(char)[] threeLetterLanguageName();
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".

final const @property const(char)[] ietfLanguageTag();
Property. Retrieves the RFC 3066 identification for a language.

Returns:
A string representing the RFC 3066 language identification.

@property Culture parent();
Property. Retrieves the Culture representing the parent of the current instance.

Returns:
The Culture representing the parent of the current instance.

const @property bool isNeutral();
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.
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


final const @property bool isReadOnly();
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.

@property Calendar calendar();
Property. Retrieves the calendar used by the culture.

Returns:
A Calendar instance respresenting the calendar used by the culture.

@property Calendar[] optionalCalendars();
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.

@property NumberFormat numberFormat();
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.

@property void numberFormat(NumberFormat value);
Property. Assigns a NumberFormat defining the culturally appropriate format for displaying numbers and currency.

Params:
values A NumberFormat defining the culturally appropriate format for displaying numbers and currency.

@property DateTimeFormat dateTimeFormat();
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.

@property void dateTimeFormat(DateTimeFormat value);
Property. Assigns a DateTimeFormat defining the culturally appropriate format for displaying dates and times.

Params:
values A DateTimeFormat defining the culturally appropriate format for displaying dates and times.

class Region;
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:
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);
Initializes a new Region instance based on the region associated with the specified culture identifier.

Params:
int cultureID A culture indentifier.

Remarks:
The name of the Region instance is set to the ISO 3166 two-letter code for that region.

this(const(char)[] name);
Initializes a new Region instance based on the region specified by name.

Params:
const(char)[] name A two-letter ISO 3166 code for the region. Or, a culture name consisting of the language and region.

static @property Region current();
Property. Retrieves the Region used by the current Culture.

Returns:
The Region instance associated with the current Culture.

const @property int geoID();
Property. Retrieves a unique identifier for the geographical location of the region.

Returns:
An int uniquely identifying the geographical location.

const @property const(char)[] name();
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.

const @property const(char)[] englishName();
Property. Retrieves the full name of the region in English.

Returns:
The full name of the region in English.

const @property const(char)[] nativeName();
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.

const @property const(char)[] twoLetterRegionName();
Property. Retrieves the two-letter ISO 3166 code of the region.

Returns:
The two-letter ISO 3166 code of the region.

const @property const(char)[] threeLetterRegionName();
Property. Retrieves the three-letter ISO 3166 code of the region.

Returns:
The three-letter ISO 3166 code of the region.

const @property const(char)[] currencySymbol();
Property. Retrieves the currency symbol of the region.

Returns:
The currency symbol of the region.

const @property const(char)[] isoCurrencySymbol();
Property. Retrieves the three-character currency symbol of the region.

Returns:
The three-character currency symbol of the region.

const @property const(char)[] currencyEnglishName();
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.

const @property const(char)[] currencyNativeName();
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.

const @property bool isMetric();
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.

immutable(char)[] toString();
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: tango.text.locale.Core.IFormatService;
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.
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();
Initializes a new, culturally independent instance.

Remarks:
Modify the properties of the new instance to define custom formatting.

Object getFormat(TypeInfo type);
Retrieves an object defining how to format the specified type.

Params:
TypeInfo type The TypeInfo of the resulting formatting object.

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

Remarks:
Implements IFormatService.getFormat.

static NumberFormat getInstance(IFormatService formatService);
Retrieves the NumberFormat for the specified IFormatService.

Params:
IFormatService formatService The 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.

static @property NumberFormat current();
Property. Retrieves a read-only NumberFormat instance from the current culture.

Returns:
A read-only NumberFormat instance from the current culture.

static NumberFormat invariantFormat();
Property. Retrieves the read-only, culturally independent NumberFormat instance.

Returns:
The read-only, culturally independent NumberFormat instance.

final const @property bool isReadOnly();
Property. Retrieves a value indicating whether the instance is read-only.

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

final const @property int numberDecimalDigits();
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.

final @property void numberDecimalDigits(int value);
Assigns the number of decimal digits used for numbers.

Params:
int value The 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.
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


final const @property int numberNegativePattern();
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 -


final @property void numberNegativePattern(int value);
Property. Assigns the format pattern for negative numbers.

Params:
int value The format pattern for negative numbers.

Examples:
The following example shows the effect of the different patterns.
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 -


final const @property int currencyDecimalDigits();
Property. Retrieves the number of decimal places to use in currency values.

Returns:
The number of decimal digits to use in currency values.

final @property void currencyDecimalDigits(int value);
Property. Assigns the number of decimal places to use in currency values.

Params:
int value The number of decimal digits to use in currency values.

final const @property int currencyNegativePattern();
Property. Retrieves the formal pattern to use for negative currency values.

Returns:
The format pattern to use for negative currency values.

final @property void currencyNegativePattern(int value);
Property. Assigns the formal pattern to use for negative currency values.

Params:
int value The format pattern to use for negative currency values.

final const @property int currencyPositivePattern();
Property. Retrieves the formal pattern to use for positive currency values.

Returns:
The format pattern to use for positive currency values.

final @property void currencyPositivePattern(int value);
Property. Assigns the formal pattern to use for positive currency values.

Returns:
The format pattern to use for positive currency values.

final const @property const(int)[] numberGroupSizes();
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.

final @property void numberGroupSizes(const(int)[] value);
Property. Assigns the number of digits int each group to the left of the decimal place in numbers.

Params:
const(int)[] value The number of digits int each group to the left of the decimal place in numbers.

final const @property const(int)[] currencyGroupSizes();
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.

final @property void currencyGroupSizes(const(int)[] value);
Property. Assigns the number of digits int each group to the left of the decimal place in currency values.

Params:
const(int)[] value The number of digits int each group to the left of the decimal place in currency values.

final const @property const(char)[] numberGroupSeparator();
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, ",".

final @property void numberGroupSeparator(const(char)[] value);
Property. Assigns the string separating groups of digits to the left of the decimal place in numbers.

Params:
const(char)[] value The string separating groups of digits to the left of the decimal place in numbers.

final const @property const(char)[] numberDecimalSeparator();
Property. Retrieves the string used as the decimal separator in numbers.

Returns:
The string used as the decimal separator in numbers. For example, ".".

final @property void numberDecimalSeparator(const(char)[] value);
Property. Assigns the string used as the decimal separator in numbers.

Params:
const(char)[] value The string used as the decimal separator in numbers.

final const @property const(char)[] currencyGroupSeparator();
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, ",".

final @property void currencyGroupSeparator(const(char)[] value);
Property. Assigns the string separating groups of digits to the left of the decimal place in currency values.

Params:
const(char)[] value The string separating groups of digits to the left of the decimal place in currency values.

final const @property const(char)[] currencyDecimalSeparator();
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, ".".

final @property void currencyDecimalSeparator(const(char)[] value);
Property. Assigns the string used as the decimal separator in currency values.

Params:
const(char)[] value The string used as the decimal separator in currency values.

final const @property const(char)[] currencySymbol();
Property. Retrieves the string used as the currency symbol.

Returns:
The string used as the currency symbol. For example, "£".

final @property void currencySymbol(const(char)[] value);
Property. Assigns the string used as the currency symbol.

Params:
const(char)[] value The string used as the currency symbol.

final const @property const(char)[] negativeSign();
Property. Retrieves the string denoting that a number is negative.

Returns:
The string denoting that a number is negative. For example, "-".

final @property void negativeSign(const(char)[] value);
Property. Assigns the string denoting that a number is negative.

Params:
const(char)[] value The string denoting that a number is negative.

final const @property const(char)[] positiveSign();
Property. Retrieves the string denoting that a number is positive.

Returns:
The string denoting that a number is positive. For example, "+".

final @property void positiveSign(const(char)[] value);
Property. Assigns the string denoting that a number is positive.

Params:
const(char)[] value The string denoting that a number is positive.

final const @property const(char)[] nanSymbol();
Property. Retrieves the string representing the NaN (not a number) value.

Returns:
The string representing the NaN value. For example, "NaN".

final @property void nanSymbol(const(char)[] value);
Property. Assigns the string representing the NaN (not a number) value.

Params:
const(char)[] value The string representing the NaN value.

final const @property const(char)[] negativeInfinitySymbol();
Property. Retrieves the string representing negative infinity.

Returns:
The string representing negative infinity. For example, "-Infinity".

final @property void negativeInfinitySymbol(const(char)[] value);
Property. Assigns the string representing negative infinity.

Params:
const(char)[] value The string representing negative infinity.

final const @property const(char)[] positiveInfinitySymbol();
Property. Retrieves the string representing positive infinity.

Returns:
The string representing positive infinity. For example, "Infinity".

final @property void positiveInfinitySymbol(const(char)[] value);
Property. Assigns the string representing positive infinity.

Params:
const(char)[] value The string representing positive infinity.

final const @property const(char[])[] nativeDigits();
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.

final @property void nativeDigits(const(char[])[] value);
Property. Assigns a string array of native equivalents of the digits 0 to 9.

Params:
const(char[])[] value A string array of native equivalents of the digits 0 to 9.

class DateTimeFormat: tango.text.locale.Core.IFormatService;
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.

package this();
Initializes an instance that is writable and culture-independent.

Object getFormat(TypeInfo type);
Retrieves an object defining how to format the specified type.

Params:
TypeInfo type The TypeInfo of the resulting formatting object.

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

Remarks:
Implements IFormatService.getFormat.

final const(char)[][] getAllDateTimePatterns();
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.

final const(char)[][] getAllDateTimePatterns(char format);
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.

final const(char)[] getAbbreviatedDayName(Calendar.DayOfWeek dayOfWeek);
Retrieves the abbreviated name of the specified day of the week based on the culture of the instance.

Params:
Calendar.DayOfWeek dayOfWeek A DayOfWeek value.

Returns:
The abbreviated name of the day of the week represented by dayOfWeek.

final const(char)[] getDayName(Calendar.DayOfWeek dayOfWeek);
Retrieves the full name of the specified day of the week based on the culture of the instance.

Params:
Calendar.DayOfWeek dayOfWeek A DayOfWeek value.

Returns:
The full name of the day of the week represented by dayOfWeek.

final const(char)[] getAbbreviatedMonthName(int month);
Retrieves the abbreviated name of the specified month based on the culture of the instance.

Params:
int month An integer between 1 and 13 indicating the name of the month to return.

Returns:
The abbreviated name of the month represented by month.

final const(char)[] getMonthName(int month);
Retrieves the full name of the specified month based on the culture of the instance.

Params:
int month An integer between 1 and 13 indicating the name of the month to return.

Returns:
The full name of the month represented by month.

static DateTimeFormat getInstance(IFormatService formatService);
Retrieves the DateTimeFormat for the specified IFormatService.

Params:
IFormatService formatService The 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.

static @property DateTimeFormat current();
Property. Retrieves a read-only DateTimeFormat instance from the current culture.

Returns:
A read-only DateTimeFormat instance from the current culture.

static DateTimeFormat invariantFormat();
Property. Retrieves a read-only DateTimeFormat instance that is culturally independent.

Returns:
A read-only DateTimeFormat instance that is culturally independent.

final @property bool isReadOnly();
Property. Retrieves a value indicating whether the instance is read-only.

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

final @property Calendar calendar();
Property. Retrieves the calendar used by the current culture.

Returns:
The Calendar determining the calendar used by the current culture. For example, the Gregorian.

final @property void calendar(Calendar value);
Property. Assigns the calendar to be used by the current culture.

Params:
Calendar value The 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.

final @property Calendar.DayOfWeek firstDayOfWeek();
Property. Retrieves the first day of the week.

Returns:
A DayOfWeek value indicating the first day of the week.

final @property void firstDayOfWeek(Calendar.DayOfWeek value);
Property. Assigns the first day of the week.

Params:
valie A DayOfWeek value indicating the first day of the week.

final @property Calendar.WeekRule calendarWeekRule();
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.

final @property void calendarWeekRule(Calendar.WeekRule value);
Property. Assigns the value indicating the rule used to determine the first week of the year.

Params:
Calendar.WeekRule value A CalendarWeekRule value determining the first week of the year.

final @property const(char)[] nativeCalendarName();
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.

final @property const(char)[] dateSeparator();
Property. Retrieves the string separating date components.

Returns:
The string separating date components.

final @property void dateSeparator(const(char)[] value);
Property. Assigns the string separating date components.

Params:
const(char)[] value The string separating date components.

final @property const(char)[] timeSeparator();
Property. Retrieves the string separating time components.

Returns:
The string separating time components.

final @property void timeSeparator(const(char)[] value);
Property. Assigns the string separating time components.

Params:
const(char)[] value The string separating time components.

final @property const(char)[] amDesignator();
Property. Retrieves the string designator for hours before noon.

Returns:
The string designator for hours before noon. For example, "AM".

final @property void amDesignator(const(char)[] value);
Property. Assigns the string designator for hours before noon.

Params:
const(char)[] value The string designator for hours before noon.

final @property const(char)[] pmDesignator();
Property. Retrieves the string designator for hours after noon.

Returns:
The string designator for hours after noon. For example, "PM".

final @property void pmDesignator(const(char)[] value);
Property. Assigns the string designator for hours after noon.

Params:
const(char)[] value The string designator for hours after noon.

final @property const(char)[] shortDatePattern();
Property. Retrieves the format pattern for a short date value.

Returns:
The format pattern for a short date value.

final @property void shortDatePattern(const(char)[] value);
Property. Assigns the format pattern for a short date value.

Params:
const(char)[] value The format pattern for a short date value.

final @property const(char)[] shortTimePattern();
Property. Retrieves the format pattern for a short time value.

Returns:
The format pattern for a short time value.

final @property void shortTimePattern(const(char)[] value);
Property. Assigns the format pattern for a short time value.

Params:
const(char)[] value The format pattern for a short time value.

final @property const(char)[] longDatePattern();
Property. Retrieves the format pattern for a long date value.

Returns:
The format pattern for a long date value.

final @property void longDatePattern(const(char)[] value);
Property. Assigns the format pattern for a long date value.

Params:
const(char)[] value The format pattern for a long date value.

final @property const(char)[] longTimePattern();
Property. Retrieves the format pattern for a long time value.

Returns:
The format pattern for a long time value.

final @property void longTimePattern(const(char)[] value);
Property. Assigns the format pattern for a long time value.

Params:
const(char)[] value The format pattern for a long time value.

final @property const(char)[] monthDayPattern();
Property. Retrieves the format pattern for a month and day value.

Returns:
The format pattern for a month and day value.

final @property void monthDayPattern(const(char)[] value);
Property. Assigns the format pattern for a month and day value.

Params:
const(char)[] value The format pattern for a month and day value.

final @property const(char)[] yearMonthPattern();
Property. Retrieves the format pattern for a year and month value.

Returns:
The format pattern for a year and month value.

final @property void yearMonthPattern(const(char)[] value);
Property. Assigns the format pattern for a year and month value.

Params:
const(char)[] value The format pattern for a year and month value.

final @property const(char)[][] abbreviatedDayNames();
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".

final @property void abbreviatedDayNames(const(char)[][] value);
Property. Assigns a string array containing the abbreviated names of the days of the week.

Params:
const(char)[][] value A string array containing the abbreviated names of the days of the week.

final @property const(char)[][] dayNames();
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".

final @property void dayNames(const(char)[][] value);
Property. Assigns a string array containing the full names of the days of the week.

Params:
const(char)[][] value A string array containing the full names of the days of the week.

final @property const(char)[][] abbreviatedMonthNames();
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 "".

final @property void abbreviatedMonthNames(const(char)[][] value);
Property. Assigns a string array containing the abbreviated names of the months.

Params:
const(char)[][] value A string array containing the abbreviated names of the months.

final @property const(char)[][] monthNames();
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 "".

final @property void monthNames(const(char)[][] value);
Property. Assigns a string array containing the full names of the months.

Params:
const(char)[][] value A string array containing the full names of the months.

final @property const(char)[] fullDateTimePattern();
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.

final @property void fullDateTimePattern(const(char)[] value);
Property. Assigns the format pattern for a long date and a long time value.

Params:
const(char)[] value The format pattern for a long date and a long time value.

final const @property const(char)[] rfc1123Pattern();
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.

final const @property const(char)[] sortableDateTimePattern();
Property. Retrieves the format pattern for a sortable date and time value.

Returns:
The format pattern for a sortable date and time value.

final const @property const(char)[] universalSortableDateTimePattern();
Property. Retrieves the format pattern for a universal date and time value.

Returns:
The format pattern for a universal date and time value.


Page generated by Ddoc. Copyright (c) 2005 John Chapman. All rights reserved