1DateTime::Locale::Base(U3s)er Contributed Perl DocumentatDiaotneTime::Locale::Base(3)
2
3
4
6 DateTime::Locale::Base - Base class for individual locale objects
7
9 use base 'DateTime::Locale::Base';
10
12 Each locale has a set of four default date and time formats. They are
13 distinguished by length, and are called "full", "long", "medium", and
14 "short". Each locale may have a different default length which it uses
15 when its "$locale->date_format_default()",
16 "$locale->time_format_default()", or
17 "$locale->datetime_format_default()" methods are called.
18
19 This can be changed by calling the "$locale->set_default_date_format()"
20 or "$locale->set_default_time_format()" methods. These methods accept
21 a string which must be one of "full", "long", "medium", or "short".
22
24 Most names come in a number of variations. First, they may vary based
25 on length, with wide, abbreviated, and narrow forms. The wide form is
26 typically the full name, while the narrow form is often a single
27 character. The narrow forms may not be unique. For example, "T" may be
28 used for Tuesday and Thursday in the English narrow forms.
29
30 Many names also distinguish between "format" and "stand-alone" forms of
31 a pattern. The format pattern is used when the thing in question is
32 being placed into a larger string. The stand-alone form is used when
33 displaying that item by itself, for example in a calendar.
34
36 All locales provide the following methods:
37
38 · $locale->id()
39
40 The locale's id.
41
42 · $locale->language_id()
43
44 The language portion of the id.
45
46 · $locale->script_id()
47
48 The script portion of the id, if any.
49
50 · $locale->territory_id()
51
52 The territory portion of the id, if any.
53
54 · $locale->variant_id()
55
56 The variant portion of the id, if any.
57
58 · $locale->name()
59
60 The full name for the locale in English.
61
62 · $locale->language()
63
64 The language name for the locale in English.
65
66 · $locale->script()
67
68 The script name for the locale in English, if any.
69
70 · $locale->territory()
71
72 The territory name for the locale in English, if any.
73
74 · $locale->variant()
75
76 The variant name for the locale in English, if any.
77
78 · $locale->native_name()
79
80 The full name for the locale in its native language, if any.
81
82 · $locale->native_language()
83
84 The language name for the locale in its native language, if any.
85
86 · $locale->native_script()
87
88 The script name for the locale in its native language, if any.
89
90 · $locale->native_territory()
91
92 The territory name for the locale in its native language, if any.
93
94 · $locale->native_variant()
95
96 The variant name for the locale in its native language, if any.
97
98 · $locale->month_format_wide()
99
100 Returns an array reference containing the wide format names of the
101 months, with January as the first month.
102
103 · $locale->month_format_abbreviated()
104
105 Returns an array reference containing the abbreviated format names
106 of the months, with January as the first month.
107
108 · $locale->month_format_narrow()
109
110 Returns an array reference containing the narrow format names of
111 the months, with January as the first month.
112
113 · $locale->month_stand_alone_wide()
114
115 Returns an array reference containing the wide stand-alone names of
116 the months, with January as the first month.
117
118 · $locale->month_stand_alone_abbreviated()
119
120 Returns an array reference containing the abbreviated stand-alone
121 names of the months, with January as the first month.
122
123 · $locale->month_stand_alone_narrow()
124
125 Returns an array reference containing the narrow stand-alone names
126 of the months, with January as the first month.
127
128 · $locale->day_format_wide()
129
130 Returns an array reference containing the wide format names of the
131 days, with Monday as the first day.
132
133 · $locale->day_format_abbreviated()
134
135 Returns an array reference containing the abbreviated format names
136 of the days, with Monday as the first day.
137
138 · $locale->day_format_narrow()
139
140 Returns an array reference containing the narrow format names of
141 the days, with Monday as the first day.
142
143 · $locale->day_stand_alone_wide()
144
145 Returns an array reference containing the wide stand-alone names of
146 the days, with Monday as the first day.
147
148 · $locale->day_stand_alone_abbreviated()
149
150 Returns an array reference containing the abbreviated stand-alone
151 names of the days, with Monday as the first day.
152
153 · $locale->day_stand_alone_narrow()
154
155 Returns an array reference containing the narrow stand-alone names
156 of the days, with Monday as the first day.
157
158 · $locale->quarter_format_wide()
159
160 Returns an array reference containing the wide format names of the
161 quarters.
162
163 · $locale->quarter_format_abbreviated()
164
165 Returns an array reference containing the abbreviated format names
166 of the quarters.
167
168 · $locale->quarter_format_narrow()
169
170 Returns an array reference containing the narrow format names of
171 the quarters.
172
173 · $locale->quarter_stand_alone_wide()
174
175 Returns an array reference containing the wide stand-alone names of
176 the quarters.
177
178 · $locale->quarter_stand_alone_abbreviated()
179
180 Returns an array reference containing the abbreviated stand-alone
181 names of the quarters.
182
183 · $locale->quarter_stand_alone_narrow()
184
185 Returns an array reference containing the narrow stand-alone names
186 of the quarters.
187
188 · $locale->era_wide()
189
190 Returns an array reference containing the wide names of the eras,
191 with "BCE" first.
192
193 · $locale->era_abbreviated()
194
195 Returns an array reference containing the abbreviated names of the
196 eras, with "BCE" first.
197
198 · $locale->era_narrow()
199
200 Returns an array reference containing the abbreviated names of the
201 eras, with "BCE" first. However, most locales do not differ between
202 the narrow and abbreviated length of the era.
203
204 · $locale->am_pm_abbreviated()
205
206 Returns an array reference containing the abbreviated names of "AM"
207 and "PM".
208
209 · $locale->date_format_long()
210
211 · $locale->date_format_full()
212
213 · $locale->date_format_medium()
214
215 · $locale->date_format_short()
216
217 Returns the CLDR date pattern of the appropriate length.
218
219 · $locale->date_formats()
220
221 Returns a hash reference of CLDR date patterns for the date
222 formats, where the keys are "full", "long", "medium", and "short".
223
224 · $locale->time_format_long()
225
226 · $locale->time_format_full()
227
228 · $locale->time_format_medium()
229
230 · $locale->time_format_short()
231
232 Returns the CLDR date pattern of the appropriate length.
233
234 · $locale->time_formats()
235
236 Returns a hash reference of CLDR date patterns for the time
237 formats, where the keys are "full", "long", "medium", and "short".
238
239 · $locale->datetime_format_long()
240
241 · $locale->datetime_format_full()
242
243 · $locale->datetime_format_medium()
244
245 · $locale->datetime_format_short()
246
247 Returns the CLDR date pattern of the appropriate length.
248
249 · $locale->datetime_formats()
250
251 Returns a hash reference of CLDR date patterns for the datetime
252 formats, where the keys are "full", "long", "medium", and "short".
253
254 · $locale->date_format_default()
255
256 · $locale->time_format_default()
257
258 · $locale->datetime_format_default()
259
260 Returns the default CLDR date pattern. The length of this format is
261 based on the value of "$locale->default_date_format_length()"
262 and/or "$locale->default_time_format_length()".
263
264 · $locale->default_date_format_length()
265
266 · $locale->default_time_format_length()
267
268 Returns the default length for the format, one of "full", "long",
269 "medium", or "short".
270
271 · $locale->set_default_date_format_length()
272
273 · $locale->set_default_time_format_length()
274
275 Sets the default length for the format. This must be one of "full",
276 "long", "medium", or "short".
277
278 · $locale->prefers_24_hour_time()
279
280 Returns a boolean indicating the preferred hour format for this
281 locale.
282
283 · $locale->first_day_of_week()
284
285 Returns a number from 1 to 7 indicating the local first day of the
286 week, with Monday being 1 and Sunday being 7. For example, for a US
287 locale this returns 7.
288
289 · $locale->available_formats()
290
291 A list of format names, like "MMdd" or "yyyyMM". This should be the
292 list directly supported by the subclass, not its parents.
293
294 · $locale->format_for($key)
295
296 Given a valid name, returns the CLDR date pattern for that thing,
297 if one exists.
298
300 See DateTime::Locale.
301
303 Richard Evans <rich@ridas.com>
304
305 Dave Rolsky <autarch@urth.org>
306
308 Copyright (c) 2003 Richard Evans. Copyright (c) 2004-2005 David Rolsky.
309 All rights reserved. This program is free software; you can
310 redistribute it and/or modify it under the same terms as Perl itself.
311
312 This program is free software; you can redistribute it and/or modify it
313 under the same terms as Perl itself.
314
315 The full text of the license can be found in the LICENSE file included
316 with this module.
317
318
319
320perl v5.16.3 2014-06-10 DateTime::Locale::Base(3)