annotate doc/formatting.txt @ 34:464fbcefedde trunk

Extended time-zone support.
author cmlenz
date Mon, 04 Jun 2007 16:03:12 +0000
parents ac0957a8fd8b
children 0df10113d5c2
rev   line source
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
1 .. -*- mode: rst; encoding: utf-8 -*-
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
3 ==========================
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
4 Number and Date Formatting
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
5 ==========================
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
6
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
7
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
8 .. contents:: Contents
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
9 :depth: 2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
10 .. sectnum::
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
11
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
12
18
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
13 Date Formatting
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
14 ===============
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
15
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
16 When working with date and time information in Python, you commonly use the
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
17 classes ``date``, ``datetime`` and/or ``time`` from the `datetime package`_.
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
18 Babel provides functions for locale-specific formatting of those objects in its
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
19 ``dates`` module::
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
20
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
21 >>> from datetime import date, datetime, time
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
22 >>> from babel.dates import format_date, format_datetime, format_time
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
23
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
24 >>> d = date(2007, 4, 1)
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
25 >>> format_date(d, locale='en')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
26 u'Apr 1, 2007'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
27 >>> format_date(d, locale='de_DE')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
28 u'01.04.2007'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
29
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
30 As this example demonstrates, Babel will automatically choose a date format
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
31 that is appropriate for the requested locale.
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
32
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
33 The ``format_*()`` functions also accept an optional ``format`` argument, which
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
34 allows you to choose between one of four format variations:
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
35
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
36 * ``short``,
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
37 * ``medium`` (the default),
20
c4fc7b88206e Fix typo in doc.
cmlenz
parents: 18
diff changeset
38 * ``long``, and
c4fc7b88206e Fix typo in doc.
cmlenz
parents: 18
diff changeset
39 * ``full``.
18
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
40
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
41 For example::
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
42
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
43 >>> format_date(d, format='short', locale='en')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
44 u'4/1/07'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
45 >>> format_date(d, format='long', locale='en')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
46 u'April 1, 2007'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
47 >>> format_date(d, format='full', locale='en')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
48 u'Sunday, April 1, 2007'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
49
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
50 .. _`datetime package`: http://docs.python.org/lib/module-datetime.html
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
51
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
52
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
53 Pattern Syntax
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
54 --------------
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
55
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
56 While Babel makes it simple to use the appropriate date/time format for a given
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
57 locale, you can also force it to use custom patterns. Note that Babel uses
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
58 different patterns for specifying number and date formats compared to the
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
59 Python equivalents (such as ``time.strftime()``), which have mostly been
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
60 inherited from C and POSIX. The patterns used in Babel are based on the
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
61 `Locale Data Markup Language specification`_ (LDML), which defines them as
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
62 follows:
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
63
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
64 A date/time pattern is a string of characters, where specific strings of
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
65 characters are replaced with date and time data from a calendar when formatting
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
66 or used to generate data for a calendar when parsing. […]
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
67
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
68 Characters may be used multiple times. For example, if ``y`` is used for the
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
69 year, ``yy`` might produce "99", whereas ``yyyy`` produces "1999". For most
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
70 numerical fields, the number of characters specifies the field width. For
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
71 example, if ``h`` is the hour, ``h`` might produce "5", but ``hh`` produces
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
72 "05". For some characters, the count specifies whether an abbreviated or full
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
73 form should be used […]
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
74
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
75 Two single quotes represent a literal single quote, either inside or outside
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
76 single quotes. Text within single quotes is not interpreted in any way (except
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
77 for two adjacent single quotes).
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
78
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
79 For example::
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
80
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
81 >>> d = date(2007, 4, 1)
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
82 >>> format_date(d, "EEE, MMM d, ''yy", locale='en')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
83 u"Sun, Apr 1, '07"
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
84 >>> format_date(d, "EEEE, d.M.yyyy", locale='de')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
85 u'Sonntag, 1.4.2007'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
86
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
87 >>> t = time(15, 30)
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
88 >>> format_time(t, "hh 'o''clock' a", locale='en')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
89 u"03 o'clock PM"
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
90 >>> format_time(t, 'H:mm a', locale='de')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
91 u'15:30 nachm.'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
92
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
93 >>> dt = datetime(2007, 4, 1, 15, 30)
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
94 >>> format_datetime(dt, "yyyyy.MMMM.dd GGG hh:mm a", locale='en')
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
95 u'02007.April.01 AD 03:30 PM'
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
96
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
97 The syntax for custom datetime format patterns is described in detail in the
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
98 the `Locale Data Markup Language specification`_. The following table is just a
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
99 relatively brief overview.
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
100
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
101 .. _`Locale Data Markup Language specification`: http://unicode.org/reports/tr35/#Date_Format_Patterns
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
102
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
103 -----------
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
104 Date Fields
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
105 -----------
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
106
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
107 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
108 | Field | Symbol | Description |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
109 +==========+========+========================================================+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
110 | Era | ``G`` | Replaced with the era string for the current date. One |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
111 | | | to three letters for the abbreviated form, four |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
112 | | | lettersfor the long form, five for the narrow form |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
113 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
114 | Year | ``y`` | Replaced by the year. Normally the length specifies |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
115 | | | the padding, but for two letters it also specifies the |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
116 | | | maximum length. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
117 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
118 | | ``Y`` | Same as ``y`` but uses the ISO year-week calendar. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
119 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
120 | | ``u`` | ?? |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
121 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
122 | Quarter | ``Q`` | Use one or two for the numerical quarter, three for |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
123 | | | the abbreviation, or four for the full name. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
124 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
125 | | ``q`` | Use one or two for the numerical quarter, three for |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
126 | | | the abbreviation, or four for the full name. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
127 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
128 | Month | ``M`` | Use one or two for the numerical month, three for the |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
129 | | | abbreviation, or four for the full name, or five for |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
130 | | | the narrow name. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
131 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
132 | | ``L`` | Use one or two for the numerical month, three for the |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
133 | | | abbreviation, or four for the full name, or 5 for the |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
134 | | | narrow name. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
135 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
136 | Week | ``w`` | Week of year. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
137 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
138 | | ``W`` | Week of month. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
139 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
140 | Day | ``d`` | Day of month. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
141 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
142 | | ``D`` | Day of year. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
143 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
144 | | ``F`` | Day of week in month. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
145 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
146 | | ``g`` | ?? |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
147 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
148 | Week day | ``E`` | Day of week. Use one through three letters for the |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
149 | | | short day, or four for the full name, or five for the |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
150 | | | narrow name. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
151 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
152 | | ``e`` | Local day of week. Same as E except adds a numeric |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
153 | | | value that will depend on the local starting day of |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
154 | | | the week, using one or two letters. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
155 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
156 | | ``c`` | ?? |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
157 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
158
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
159 -----------
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
160 Time Fields
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
161 -----------
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
162
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
163 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
164 | Field | Symbol | Description |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
165 +==========+========+========================================================+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
166 | Period | ``a`` | AM or PM |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
167 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
168 | Hour | ``h`` | Hour [1-12]. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
169 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
170 | | ``H`` | Hour [0-23]. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
171 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
172 | | ``K`` | Hour [0-11]. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
173 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
174 | | ``k`` | Hour [1-24]. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
175 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
176 | Minute | ``m`` | Use one or two for zero places padding. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
177 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
178 | Second | ``s`` | Use one or two for zero places padding. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
179 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
180 | | ``S`` | Fractional second, rounds to the count of letters. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
181 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
182 | | ``A`` | Milliseconds in day. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
183 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
184 | Timezone | ``z`` | Use one to three letters for the short timezone or |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
185 | | | four for the full name. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
186 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
187 | | ``Z`` | Use one to three letters for RFC 822, four letters for |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
188 | | | GMT format. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
189 | +--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
190 | | ``v`` | Use one letter for short wall (generic) time, four for |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
191 | | | long wall time. |
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
192 +----------+--------+--------------------------------------------------------+
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
193
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
194
31
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
195 Time-Zone Support
29
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
196 -----------------
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
197
31
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
198 Many of the verbose time formats include the time-zone, but time-zone
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
199 information is not by default available for the Python ``datetime`` and
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
200 ``time`` objects. The standard library includes only the abstract ``tzinfo``
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
201 class, which you need appropriate implementations for to actually use in your
29
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
202 application. Babel includes a ``tzinfo`` implementation for UTC (Universal
31
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
203 Time).
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
204
f3049ca45daa Raise error on unsupported locales. Closes #5.
cmlenz
parents: 29
diff changeset
205 For real time-zone support, it is strongly recommended that you use the
29
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
206 third-party package `pytz`_, which includes the definitions of practically all
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
207 of the time-zones used on the world, as well as important functions for
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
208 reliably converting from UTC to local time, and vice versa::
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
209
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
210 >>> from datetime import time
34
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
211 >>> from pytz import timezone, utc
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
212 >>> dt = datetime(2007, 04, 01, 15, 30, tzinfo=utc)
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
213 >>> eastern = timezone('US/Eastern')
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
214 >>> format_datetime(dt, 'H:mm Z', tzinfo=eastern, locale='en_US')
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
215 u'11:30 -0400'
29
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
216
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
217 The recommended approach to deal with different time-zones in a Python
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
218 application is to always use UTC internally, and only convert from/to the users
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
219 time-zone when accepting user input and displaying date/time data, respectively.
34
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
220 You can use Babel together with ``pytz`` to apply a time-zone to any
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
221 ``datetime`` or ``time`` object for display, leaving the original information
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
222 unchanged::
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
223
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
224 >>> british = timezone('Europe/London')
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
225 >>> format_datetime(dt, 'H:mm zzzz', tzinfo=british, locale='en_US')
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
226 u'16:30 British Summer Time'
29
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
227
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
228 .. _`pytz`: http://pytz.sourceforge.net/
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
229
72bf45adb926 More work on timezones.
cmlenz
parents: 20
diff changeset
230
18
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
231 Parsing Dates
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
232 -------------
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
233
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
234 Babel can also parse date and time information in a locale-sensitive manner::
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
235
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
236 >>> from babel.dates import parse_date, parse_datetime, parse_time
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
237
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
238
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
239 Number Formatting
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
240 =================
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
241
32
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
242 Support for locale-specific formatting and parsing of numbers is provided by
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
243 the ``babel.numbers`` module::
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
244
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
245 >>> from babel.numbers import format_number, format_decimal, format_percent
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
246
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
247 Examples::
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
248
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
249 >>> format_decimal(1.2345, locale='en_US')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
250 u'1.234'
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
251 >>> format_decimal(1.2345, locale='sv_SE')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
252 u'1,234'
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
253 >>> format_decimal(12345, locale='de_DE')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
254 u'12.345'
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
255
18
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
256
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
257 Pattern Syntax
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
258 --------------
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
259
32
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
260 While Babel makes it simple to use the appropriate number format for a given
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
261 locale, you can also force it to use custom patterns. As with date/time
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
262 formatting patterns, the patterns Babel supports for number formatting are
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
263 based on the `Locale Data Markup Language specification`_ (LDML).
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
264
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
265 Examples::
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
266
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
267 >>> format_decimal(-1.2345, format='#,##0.##;-#', locale='en')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
268 u'-1.23'
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
269 >>> format_decimal(-1.2345, format='#,##0.##;(#)', locale='en')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
270 u'(1.23)'
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
271
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
272 The syntax for custom number format patterns is described in detail in the
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
273 the specification. The following table is just a relatively brief overview.
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
274
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
275 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
276 | Symbol | Description |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
277 +==========+=================================================================+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
278 | ``0`` | Digit |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
279 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
280 | ``1-9`` | '1' through '9' indicate rounding. |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
281 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
282 | ``@`` | Significant digit |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
283 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
284 | ``#`` | Digit, zero shows as absent |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
285 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
286 | ``.`` | Decimal separator or monetary decimal separator |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
287 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
288 | ``-`` | Minus sign |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
289 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
290 | ``,`` | Grouping separator |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
291 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
292 | ``E`` | Separates mantissa and exponent in scientific notation |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
293 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
294 | ``+`` | Prefix positive exponents with localized plus sign |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
295 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
296 | ``;`` | Separates positive and negative subpatterns |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
297 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
298 | ``%`` | Multiply by 100 and show as percentage |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
299 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
300 | ``‰`` | Multiply by 1000 and show as per mille |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
301 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
302 | ``¤`` | Currency sign, replaced by currency symbol. If doubled, |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
303 | | replaced by international currency symbol. If tripled, uses the |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
304 | | long form of the decimal symbol. |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
305 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
306 | ``'`` | Used to quote special characters in a prefix or suffix |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
307 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
308 | ``*`` | Pad escape, precedes pad character |
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
309 +----------+-----------------------------------------------------------------+
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
310
18
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
311
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
312 Parsing Numbers
990909fdf98b Started documentation for date formatting, plus some code tweaks in that area.
cmlenz
parents: 2
diff changeset
313 ---------------
32
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
314
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
315 Babel can also parse numeric data in a locale-sensitive manner::
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
316
34
464fbcefedde Extended time-zone support.
cmlenz
parents: 32
diff changeset
317 >>> from babel.numbers import parse_decimal, parse_number
32
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
318
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
319 Examples::
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
320
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
321 >>> parse_decimal('1,099.98', locale='en_US')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
322 1099.98
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
323 >>> parse_decimal('1.099,98', locale='de')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
324 1099.98
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
325 >>> parse_decimal('2,109,998', locale='de')
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
326 Traceback (most recent call last):
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
327 ...
ac0957a8fd8b Started docs on number formatting/parsing.
cmlenz
parents: 31
diff changeset
328 NumberFormatError: '2,109,998' is not a valid decimal number
Copyright (C) 2012-2017 Edgewall Software