Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
DateTime::Locale::FromUser(Contributed Perl DocumDateTime::Locale::FromData(3)

       DateTime::Locale::FromData - Class for locale objects instantiated from
       pre-defined data

       version 1.26

	 my $locale = DateTime::Locale::FromData->new(%lots_of_data)

       This class is used to represent locales instantiated from the data in
       the DateTime::Locale::Data module.

       This class provides the following methods:

       The complete locale id, something like "en-US".

       The language portion of the code, like "en".

       The script portion of the code, like "Hant".

       The territory portion of	the code, like "US".

       The variant portion of the code,	like "POSIX".

       The locale's complete name, which always	includes at least a language
       component, plus optional	territory and variant components. Something
       like "English United States". The value returned	will always be in

       The relevant component from the locale's	complete name, like "English"
       or "United States".

       The locale's complete name in localized form as a UTF-8 string.

       The relevant component from the locale's	complete native	name as	a
       UTF-8 string.

       These methods all return	an array reference containing the specified

       The methods with	"format" in the	name should return strings that	can be
       used a part of a	string,	like "the month	of July". The stand alone
       values are for use in things like calendars as opposed to a sentence.

       The narrow forms	may not	be unique (for example,	in the day column
       heading for a calendar it's okay	to have	"T" for	both Tuesday and

       The wide	name should always be the full name of thing in	question. The
       narrow name should be just one or two characters.

       These methods return strings appropriate	for the
       "DateTime->format_cldr" method.

       These are accessed by passing a name to "$locale->format_for(...)",
       where the name is a CLDR-style format specifier.

       The return value	is a string suitable for passing to
       "$dt->format_cldr", so you can do something like	this:

	 print $dt->format_cldr( $dt->locale->format_for('MMMdd') )

       which for the "en" locale would print out something like	"08 Jul".

       Note that the localization may also include additional text specific to
       the locale. For example,	the "MMMMd" format for the "zh"	locale
       includes	the Chinese characters for "day" (aeY) and month (ae), so you
       get something like "8ae23aeY".

       This should return a list of all	the format names that could be passed
       to "$locale->format_for".

       See the documentation for individual locales for	details	and examples
       of these	formats. The format names that are available vary by locale.

       These methods return strings appropriate	for the	"DateTime->strftime"
       method. However,	you are	strongly encouraged to use the other format
       methods,	which use the CLDR format data.	They are primarily included
       for the benefit for DateTime::Format::Strptime.

       The CLDR	version	from which this	locale was generated.

       Returns a boolean indicating whether or not the locale prefers 24-hour

       Returns a number	from 1 to 7 indicating the local first day of the
       week, with Monday being 1 and Sunday being 7.

       Returns the original data used to create	this locale as a hash. This is
       here to facilitate creating custom locale that via

       Bugs may	be submitted at

       There is	a mailing list available for users of this distribution,

       I am also usually active	on IRC as 'autarch' on "irc://".

       The source code repository for DateTime-Locale can be found at

       Dave Rolsky <>

       This software is	copyright (c) 2003 - 2020 by Dave Rolsky.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

       The full	text of	the license can	be found in the	LICENSE	file included
       with this distribution.

perl v5.32.0			  2020-07-03	 DateTime::Locale::FromData(3)


Want to link to this manual page? Use this URL:

home | help