comparison doc/formatting.txt @ 98:f5cfd37ec37e trunk

Add `--without-apidocs` switch to `build_doc` command for quicker doc-edit/review cycles.
author cmlenz
date Wed, 13 Jun 2007 07:48:06 +0000
parents 0739bc8e7210
children
comparison
equal deleted inserted replaced
97:4e5c9dc57f1d 98:f5cfd37ec37e
12 12
13 Date Formatting 13 Date Formatting
14 =============== 14 ===============
15 15
16 When working with date and time information in Python, you commonly use the 16 When working with date and time information in Python, you commonly use the
17 classes ``date``, ``datetime`` and/or ``time`` from the `datetime package`_. 17 classes ``date``, ``datetime`` and/or ``time`` from the `datetime`_ package.
18 Babel provides functions for locale-specific formatting of those objects in its 18 Babel provides functions for locale-specific formatting of those objects in its
19 ``dates`` module: 19 ``dates`` module:
20
21 .. _`datetime`: http://docs.python.org/lib/module-datetime.html
20 22
21 .. code-block:: pycon 23 .. code-block:: pycon
22 24
23 >>> from datetime import date, datetime, time 25 >>> from datetime import date, datetime, time
24 >>> from babel.dates import format_date, format_datetime, format_time 26 >>> from babel.dates import format_date, format_datetime, format_time
48 u'4/1/07' 50 u'4/1/07'
49 >>> format_date(d, format='long', locale='en') 51 >>> format_date(d, format='long', locale='en')
50 u'April 1, 2007' 52 u'April 1, 2007'
51 >>> format_date(d, format='full', locale='en') 53 >>> format_date(d, format='full', locale='en')
52 u'Sunday, April 1, 2007' 54 u'Sunday, April 1, 2007'
53
54 .. _`datetime package`: http://docs.python.org/lib/module-datetime.html
55 55
56 56
57 Pattern Syntax 57 Pattern Syntax
58 -------------- 58 --------------
59 59
Copyright (C) 2012-2017 Edgewall Software