| 1 |
Date and Time |
| 2 |
============= |
| 3 |
|
| 4 |
.. module:: babel.dates |
| 5 |
|
| 6 |
The date and time functionality provided by Babel lets you format standard |
| 7 |
Python `datetime`, `date` and `time` objects and work with timezones. |
| 8 |
|
| 9 |
Date and Time Formatting |
| 10 |
------------------------ |
| 11 |
|
| 12 |
.. autofunction:: format_datetime(datetime=None, format='medium', tzinfo=None, locale=default_locale('LC_TIME')) |
| 13 |
|
| 14 |
.. autofunction:: format_date(date=None, format='medium', locale=default_locale('LC_TIME')) |
| 15 |
|
| 16 |
.. autofunction:: format_time(time=None, format='medium', tzinfo=None, locale=default_locale('LC_TIME')) |
| 17 |
|
| 18 |
.. autofunction:: format_timedelta(delta, granularity='second', threshold=.85, add_direction=False, format='long', locale=default_locale('LC_TIME')) |
| 19 |
|
| 20 |
.. autofunction:: format_skeleton(skeleton, datetime=None, tzinfo=None, fuzzy=True, locale=default_locale('LC_TIME')) |
| 21 |
|
| 22 |
.. autofunction:: format_interval(start, end, skeleton=None, tzinfo=None, fuzzy=True, locale=default_locale('LC_TIME')) |
| 23 |
|
| 24 |
Timezone Functionality |
| 25 |
---------------------- |
| 26 |
|
| 27 |
.. autofunction:: get_timezone |
| 28 |
|
| 29 |
.. autofunction:: get_timezone_gmt |
| 30 |
|
| 31 |
.. autofunction:: get_timezone_location |
| 32 |
|
| 33 |
.. autofunction:: get_timezone_name |
| 34 |
|
| 35 |
.. data:: UTC |
| 36 |
|
| 37 |
A timezone object for UTC. |
| 38 |
|
| 39 |
.. data:: LOCALTZ |
| 40 |
|
| 41 |
A timezone object for the computer's local timezone. |
| 42 |
|
| 43 |
.. autoclass:: TimezoneTransition |
| 44 |
|
| 45 |
Data Access |
| 46 |
----------- |
| 47 |
|
| 48 |
.. autofunction:: get_period_names |
| 49 |
|
| 50 |
.. autofunction:: get_day_names |
| 51 |
|
| 52 |
.. autofunction:: get_month_names |
| 53 |
|
| 54 |
.. autofunction:: get_quarter_names |
| 55 |
|
| 56 |
.. autofunction:: get_era_names |
| 57 |
|
| 58 |
.. autofunction:: get_date_format |
| 59 |
|
| 60 |
.. autofunction:: get_datetime_format |
| 61 |
|
| 62 |
.. autofunction:: get_time_format |
| 63 |
|
| 64 |
Basic Parsing |
| 65 |
------------- |
| 66 |
|
| 67 |
.. autofunction:: parse_date |
| 68 |
|
| 69 |
.. autofunction:: parse_time |
| 70 |
|
| 71 |
.. autofunction:: parse_pattern |