summaryrefslogtreecommitdiff
path: root/docs/api/dates.rst
blob: f3e59b63bf49af1c136ac83c45f31ec5d8a53487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Date and Time
=============

.. module:: babel.dates

The date and time functionality provided by Babel lets you format standard
Python `datetime`, `date` and `time` objects and work with timezones.

Date and Time Formatting
------------------------

.. autofunction:: format_datetime(datetime=None, format='medium', tzinfo=None, locale=default_locale('LC_TIME'))

.. autofunction:: format_date(date=None, format='medium', locale=default_locale('LC_TIME'))

.. autofunction:: format_time(time=None, format='medium', tzinfo=None, locale=default_locale('LC_TIME'))

.. autofunction:: format_timedelta(delta, granularity='second', threshold=.85, add_direction=False, format='long', locale=default_locale('LC_TIME'))

.. autofunction:: format_skeleton(skeleton, datetime=None, tzinfo=None, fuzzy=True, locale=default_locale('LC_TIME'))

.. autofunction:: format_interval(start, end, skeleton=None, tzinfo=None, fuzzy=True, locale=default_locale('LC_TIME'))

Timezone Functionality
----------------------

.. autofunction:: get_timezone

.. autofunction:: get_timezone_gmt

.. autofunction:: get_timezone_location

.. autofunction:: get_timezone_name

.. autofunction:: get_next_timezone_transition

.. data:: UTC

    A timezone object for UTC.

.. data:: LOCALTZ

    A timezone object for the computer's local timezone.

Data Access
-----------

.. autofunction:: get_period_names

.. autofunction:: get_day_names

.. autofunction:: get_month_names

.. autofunction:: get_quarter_names

.. autofunction:: get_era_names

.. autofunction:: get_date_format

.. autofunction:: get_datetime_format

.. autofunction:: get_time_format

Basic Parsing
-------------

.. autofunction:: parse_date

.. autofunction:: parse_time

.. autofunction:: parse_pattern