Files
intellecton/venv/lib/python3.12/site-packages/babel/__pycache__/dates.cpython-312.pyc
T

1008 lines
84 KiB
Plaintext
Raw Normal View History

Ë
j)ãóUdZddlmZddlZddlZddlZddlmZddlm Z m
Z
m Z  ddl Z ddlZddlmZddlmZddlmZmZmZdd lmZe rrdd
lmZej8ej:zezdzZd e d <e
d
Z!d e d<e
dZ"d e d<ejejFze$ze%zej:zdzZ&d e d<dZ'ejPjRZ*ejVZ+ed«Z,dodZ- dpdZ.dqdZ/drdZ0 ds dtdZ1 ds dudZ2dsdvdZ3 dw dxdZ4 dy dzdZ5 dy dxdZ6 dy dxdZ7 d{ d|dZ8 d} d~d!„Z9 d} d~d"„Z: d} d~d#„Z; d d€d$„Z< d dd%„Z= d„d&„Z> d… d†d'„Z? d‡ dˆd(„Z@ d‡ d‰d)„ZA dd*„ZBd+ZCd,e d-< dd.„ZD dŽd/„ZE dd0„ZF d dd1„ZGGd2„d3eH«ZI d d“d4„ZJ d d”d5„ZKGd6„d «ZLGd7„d8«ZMid9gd:¢d;dd<dd=dd>gd:¢d?gd:¢d@gd:¢dAgd:¢dBdCdDgdEdCgdFdCdDgdGgdH¢dIdCgdJddKgdL¢dMgdL¢dNgdO¢idPgd:¢dQgd:¢dRgd:¢dSdCdDgdTdCdDgdUdCdDgdVdCdDgdWdCdDgdXdCdDgdYddZdd[gd\¢d]gd:¢d^dCd_gd`dCd_gdagd\¢dbgd:¢¥dcgd:¢i¥ZNdde de<dfZOd•dg„ZPedh¬i«ddj„«ZQd—dk„ZRd˜dl„ZSd™dm„ZT ddn„ZUy#e
$r
dZ ddlZYŒTwxYw)œa[
babel.dates
~~~~~~~~~~~
Locale dependent formatting and parsing of dates and times.
The default locale for the functions in this module is determined by the
following environment variables, in that order:
* ``LC_TIME``,
* ``LC_ALL``, and
* ``LANG``
:copyright: (c) 2013-2026 by the Babel Team.
:license: BSD, see LICENSE for more details.
é)Ú annotationsN)Ú lru_cache)Ú
TYPE_CHECKINGÚLiteralÚ SupportsInt)ÚIterable)Ú localtime)ÚLocaleÚdefault_localeÚ
get_global)ÚLocaleDataDict)Ú TypeAliasrÚ_Instant©ÚfullÚlongÚmediumÚshortÚ_PredefinedTimeFormat)Úformatú stand-aloneÚ_ContextÚ _DtOrTzinfou ∅∅∅ÚLC_TIMEcóº|j|ur|St|d«r|j|«S|j|j|¬«S|j |«S)localize©Útzinfo)rÚhasattrrÚreplaceÚ
astimezone)ÚtzÚdts úN/home/antigravity/intellecton/venv/lib/python3.12/site-packages/babel/dates.pyÚ _localizer%>sXð
‡yyB؈ äˆrØ{‰{˜2‹Ðà ‡yàz‰z ˆzÓ =‰=˜Ó ÐócóŽ|€(tjj«}t}||fSt|t«rd}t |«}||fSt|t «r d}t}||fSt|tjtjf«r-t|«}|j |jnt}||fSd}|}||fS)
Parse a `dt_or_tzinfo` value into a datetime and a tzinfo.
See the docs for this function's callers for semantics.
:rtype: tuple[datetime, tzinfo]
N) ÚdatetimeÚnowÚLOCALTZÚ
isinstanceÚstrÚ get_timezoneÚintÚUTCÚtimeÚ
_get_datetimer©Ú dt_or_tzinfor#rs r$Ú_get_dt_and_tzinfor4OðÐÜ
×
Ñ
×
܈ð ˆvˆ:Ðô
L¤#Ô &Ø
ˆÜ˜lÓð ˆvˆ:Ðô
L¤#Ô &Ø
ˆÜˆð ˆvˆ:Ðô
L¤8×#4Ñ#4´h·m±mÐ"DÔ EÜ
˜
Ø Ÿi™iÐ3¼ˆð ˆvˆ:ÐðˆØˆØ
ˆvˆr&cót|«\}}t|d«r |jSt|d«r|j |jS|j |xs#t
j
j
t««S)z[
Get the timezone name out of a time, datetime, or tzinfo object.
:rtype: str
ÚzoneÚkey)r4rr6r7Útznamer(r)r/r2s r$Ú _get_tz_namer9kshô $ 1J€BˆÜˆvØ{‰{ÐÜ ˜Ô  F§J¡JÐ$:Øz‰zÐà}‰}˜=¤8×#4Ñ#4×#8Ñ#8¼Ó#=Ó>r&có||€3tjjt«jd¬«St |t
t f«r4tjj|t«jd¬«St |tj«r<tjjtjj«|«St |tj«rLt |tj«s2tjj|tj««S|S)a„
Get a datetime out of an "instant" (date, time, datetime, number).
.. warning:: The return values of this function may depend on the system clock.
If the instant is None, the current moment is used.
If the instant is a time, it's augmented with today's date.
Dates are converted to naive datetimes with midnight as the time component.
>>> from datetime import date, datetime
>>> _get_datetime(date(2015, 1, 1))
datetime.datetime(2015, 1, 1, 0, 0)
UNIX timestamps are converted to datetimes.
>>> _get_datetime(1400000000)
datetime.datetime(2014, 5, 13, 16, 53, 20)
Other values are passed through as-is.
>>> x = datetime(2015, 1, 1)
>>> _get_datetime(x) is x
True
:param instant: date, time, datetime, integer, float or None
:type instant: date|time|datetime|int|float|None
:return: a datetime
:rtype: datetime
Nr) r(r)r/r r+r.ÚfloatÚ
fromtimestampr0ÚcombineÚdateÚtoday)Úinstants r$r1r1zð>Ü× Ñ ×$¤SÓ1¸ÐGœc¤5˜\Ô *Ü× Ñ ×.¨w¼Ó<×DÈDÐGœXŸ]™]Ô +Ü× Ñ ×¯©×)<Ñ)<Ó)>ÀÓGœXŸ]™]Ô +´J¸×HYÑHYÔ4ZÜ× Ñ ×´(·-±-³/Ó €Nr&có¼|j|jt¬«}|7|jt |««}t |d«r|j
|«}|S)aS
Ensure the datetime passed has an attached tzinfo.
If the datetime is tz-naive to begin with, UTC is attached.
If a tzinfo is passed in, the datetime is normalized to that timezone.
>>> from datetime import datetime
>>> _get_tz_name(_ensure_datetime_tzinfo(datetime(2015, 1, 1)))
'UTC'
>>> tz = get_timezone("Europe/Stockholm")
>>> _ensure_datetime_tzinfo(datetime(2015, 1, 1, 13, 15, tzinfo=UTC), tzinfo=tz).hour
14
:param datetime: Datetime to augment.
:param tzinfo: optional tzinfo
:return: datetime with tzinfo
:rtype: datetime
rÚ normalize)rr r/r!r-rrB)r#rs r$Ú_ensure_datetime_tzinforC¥sVð0
‡yØ
Z‰Zœsˆ
#ˆØ
ÐØ
]‰]œ<¨Ó
0ˆÜ 6˜ ×! %ˆ
€Ir&cóê|€$tjjt«}n:t|tt
f«r$tjj
|t«}|j|jt¬«}t|tj«rB|.|j|«}t|d«r|j|«}|j«}|S||j|¬«}|S)
Get a timezoned time from a given instant.
.. warning:: The return values of this function may depend on the system clock.
:param time: time, datetime or None
:rtype: time
rrB)
r(r)r/r+r.r;r<rr r!rrBÚtimetz)r0rs r$Ú _get_timerFÆð €|Ü× Ñ ×$¤SÓ)‰Ü Dœ3¤˜,Ô 'Ü× Ñ ×.¨t´SÓà ‡{Ø|‰|¤3ˆ|Ó'ˆä× Ð Ø—?‘? 6Ó*ˆDÜv˜×Ó-Ø{‰{}ˆð €Kð
Ð Ø|‰| 6ˆ*ˆØ €Kr&cóP|tSt|t«s|Str tj|«St sJ t
j|«S#tj
$r }|}Yd}~n*d}~wwxYw#t j$r }|}Yd}~nd}~wwxYwtd|«|)aLooks up a timezone by name and returns it. The timezone object
returned comes from ``pytz`` or ``zoneinfo``, whichever is available.
It corresponds to the `tzinfo` interface and can be used with all of
the functions of Babel that operate with dates.
If a timezone is not known a :exc:`LookupError` is raised. If `zone`
is ``None`` a local zone object is returned.
:param zone: the name of the timezone to look up. If a timezone object
itself is passed in, it's returned unchanged.
NzUnknown timezone )
r*r+r,ÚpytzÚtimezoneÚUnknownTimeZoneErrorÚzoneinfoÚZoneInfoÚZoneInfoNotFoundErrorÚ LookupError)r6Úexcs r$r-r-åð €|ÜˆÜ dœCÔ Øˆ å ð Ü—== Ó ˆˆ Ü×$ TÓ *øô × ØCûð ûô × ØCûð úô Ð)¨$¨Ð
1°sÐ:s/¢AÁA7ÁA4Á(A/Á/A4Á7BÂ
BÂBcó\tj|xst«j||S)akReturn the names for day periods (AM/PM) used by the locale.
>>> get_period_names(locale='en_US')['am']
'AM'
:param width: the width to use, one of "abbreviated", "narrow", or "wide"
:param context: the context, either "format" or "stand-alone"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
)r
ÚparserÚ day_periods©ÚwidthÚcontextÚlocales r$Úget_period_namesrXs(ô <‰<˜Ò)¤'Ó *× 6°wÑ Ñ Fr&có\tj|xst«j||S)aKReturn the day names used by the locale for the specified format.
>>> get_day_names('wide', locale='en_US')[1]
'Tuesday'
>>> get_day_names('short', locale='en_US')[1]
'Tu'
>>> get_day_names('abbreviated', locale='es')[1]
'mar'
>>> get_day_names('narrow', context='stand-alone', locale='de_DE')[1]
'D'
:param width: the width to use, one of "wide", "abbreviated", "short" or "narrow"
:param context: the context, either "format" or "stand-alone"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
)r
rRrÚdaysrTs r$Ú
get_day_namesr[s(ô( <‰<˜Ò)¤'Ó *× Ñ 8¸Ñ ?r&có\tj|xst«j||S)aReturn the month names used by the locale for the specified format.
>>> get_month_names('wide', locale='en_US')[1]
'January'
>>> get_month_names('abbreviated', locale='es')[1]
'ene'
>>> get_month_names('narrow', context='stand-alone', locale='de_DE')[1]
'J'
:param width: the width to use, one of "wide", "abbreviated", or "narrow"
:param context: the context, either "format" or "stand-alone"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
)r
rRrÚmonthsrTs r$Úget_month_namesr^-s(ô$ <‰<˜Ò)¤'Ó *× 1°'Ñ :¸ Ar&có\tj|xst«j||S)aReturn the quarter names used by the locale for the specified format.
>>> get_quarter_names('wide', locale='en_US')[1]
'1st quarter'
>>> get_quarter_names('abbreviated', locale='de_DE')[1]
'Q1'
>>> get_quarter_names('narrow', locale='de_DE')[1]
'1'
:param width: the width to use, one of "wide", "abbreviated", or "narrow"
:param context: the context, either "format" or "stand-alone"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
)r
rRrÚquartersrTs r$Úget_quarter_namesraBs(ô$ <‰<˜Ò)¤'Ó *× 3°GÑ <¸ Cr&cóVtj|xst«j|S)aReturn the era names used by the locale for the specified format.
>>> get_era_names('wide', locale='en_US')[1]
'Anno Domini'
>>> get_era_names('abbreviated', locale='de_DE')[1]
'n. Chr.'
:param width: the width to use, either "wide", "abbreviated", or "narrow"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
)r
rRrÚeras©rUrWs r$Ú
get_era_namesreWs#ô <‰<˜Ò)¤'Ó *× Ñ 6r&ÚDateTimePatterncóVtj|xst«j|S)Return the date formatting patterns used by the locale for the specified
format.
>>> get_date_format(locale='en_US')
<DateTimePattern 'MMM d, y'>
>>> get_date_format('full', locale='de_DE')
<DateTimePattern 'EEEE, d. MMMM y'>
:param format: the format to use, one of "full", "long", "medium", or
"short"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
)r
rRrÚ date_formats©rrWs r$Úget_date_formatrjhó#ô <‰<˜Ò)¤'Ó *× 7¸Ñ ?r&cóftj|xst«j}||vrd}||S)a_Return the datetime formatting patterns used by the locale for the
specified format.
>>> get_datetime_format(locale='en_US')
'{1}, {0}'
:param format: the format to use, one of "full", "long", "medium", or
"short"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
N)r
rRrÚdatetime_formats)rrWÚpatternss r$Úget_datetime_formatro{s5ô|‰|˜-¤gÓ?€HØ
ØˆØ  Ðr&cóVtj|xst«j|S)Return the time formatting patterns used by the locale for the specified
format.
>>> get_time_format(locale='en_US')
<DateTimePattern 'h:mm:ss\u202fa'>
>>> get_time_format('full', locale='de_DE')
<DateTimePattern 'HH:mm:ss zzzz'>
:param format: the format to use, one of "full", "long", "medium", or
"short"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
)r
rRrÚ time_formatsris r$Úget_time_formatrrrkr&có–tt|««}tj|xst«}|j
j
|«}|jdzdzdz|jz}t|d«\}}|r |dk(r|dk(ry|dk(r
|dk(rd|zS|dk(s|dk(rd }n|d
k(rd }n|jd d z}|||dzfzS)
a.Return the timezone associated with the given `datetime` object formatted
as string indicating the offset from GMT.
>>> from datetime import datetime
>>> dt = datetime(2007, 4, 1, 15, 30)
>>> get_timezone_gmt(dt, locale='en')
'GMT+00:00'
>>> get_timezone_gmt(dt, locale='en', return_z=True)
'Z'
>>> get_timezone_gmt(dt, locale='en', width='iso8601_short')
'+00'
>>> tz = get_timezone('America/Los_Angeles')
>>> dt = _localize(tz, datetime(2007, 4, 1, 15, 30))
>>> get_timezone_gmt(dt, locale='en')
'GMT-07:00'
>>> get_timezone_gmt(dt, 'short', locale='en')
'-0700'
>>> get_timezone_gmt(dt, locale='en', width='iso8601_short')
'-07'
The long format depends on the locale, for example in France the acronym
UTC string is used instead of GMT:
>>> get_timezone_gmt(dt, 'long', locale='fr_FR')
'UTC-07:00'
.. versionadded:: 0.9
:param datetime: the ``datetime`` object; if `None`, the current date and
time in UTC is used
:param width: either "long" or "short" or "iso8601" or "iso8601_short"
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
:param return_z: True or False; Function returns indicator "Z"
when local time offset is 0
éé<érÚ
iso8601_shortz%+03drz %+03d%02dÚiso8601z
%+03d:%02dÚgmt) rCr1r
rRrrÚ utcoffsetrZÚsecondsÚdivmodÚ zone_formats)r(rUrWÚreturn_zÚoffsetr|ÚhoursÚpatterns r$Úget_timezone_gmtrƒ¢ôR'¤}°XÓ'>Ó?€HÜ
\‰\˜+¤GÓ
,€Fà
_‰_×
& 
0€FØk‰k˜ Ñ# (¨6¯>©>Ñ9€GܘG *N€EˆE˜QJ 7¨a¢<ØØ ˜% ˜ÐØ ˜U Ø Øà×% eÑ,¨|ÑØ e˜™]Ð +r&cóøtj|xst«}t|«}t d«j ||«}|j j |i«}|jd}t d«j |«}||jvrd}|j|}|s.|r,tt d«j |g««dk(r||zS|jd}d|vr|d} n|t d «j |«}
|jj |
i«} d| vr| d} n<d
|vr&|jd
d«djd d «} n|jd d «} |r| S||| |d
œzzS)Return a representation of the given timezone using "location format".
The result depends on both the local display name of the country and the
city associated with the time zone:
>>> tz = get_timezone('America/St_Johns')
>>> print(get_timezone_location(tz, locale='de_DE'))
Kanada (St. John’s) (Ortszeit)
>>> print(get_timezone_location(tz, locale='en'))
Canada (St. John’s) Time
>>> print(get_timezone_location(tz, locale='en', return_city=True))
St. John’s
>>> tz = get_timezone('America/Mexico_City')
>>> get_timezone_location(tz, locale='de_DE')
'Mexiko (Mexiko-Stadt) (Ortszeit)'
If the timezone is associated with a country that uses only a single
timezone, just the localized country name is returned:
>>> tz = get_timezone('Europe/Berlin')
>>> get_timezone_name(tz, locale='de_DE')
'Mitteleuropäische Zeit'
.. versionadded:: 0.9
:param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines
the timezone; if `None`, the current date and time in
UTC is assumed
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
:param return_city: True or False, if True then return exemplar city (location)
for the time zone
:return: the localized timezone name using location format
Ú zone_aliasesÚregionÚzone_territoriesÚZZÚterritory_zoneséÚfallbackÚcityÚ
meta_zonesú )Ú1)
r
rRrr9r ÚgetÚ
time_zonesr~Ú territoriesÚlenrÚsplitr ) r3rWÚ return_cityr6ÚinfoÚ
region_formatÚ territoryÚterritory_nameÚfallback_formatÚ city_nameÚmetazoneÚ
metazone_infos r$Úget_timezone_locationr¡ÞsôN\‰\˜+¤GÓ
,€Fä ˜ Ó %€Dô  )¨$°Ó 5€Dà × Ñ × Ñ   rÓ *€Dð×Ñ1€MÜÐ2°4Ó8€Iؘ׈ Ø×'¨ Ñ2€Ná Ù Ü 
Ð1°)¸RÓ AÀQÒ ˜~Ñ×)¨*Ñ5€OØ
˜‘L‰ ä˜lÓÓØ×-¨h¸Ó
Ø  % -‰IØ
D‰[ØŸ
 3¨Ó*¨1Ñ5°c¸3Ó?‰IàŸ  S¨#Ó.ˆIáØÐØ ØàØñ
ñ
ñ ðr&cóÎt|«\}}tj|xst«}t |«}||d}n'|j |«} | rdnd}n|dvr t
d«td«j||«}|r|S|jj|i«}
||
vr||
|vr|
||} | tk7r| Std«j|«} | rp|jj| i«}
||
vrP|
|j|«}|dk(r*|tk(r!|
jd i«j|«}|r |tk7r|S|t|||¬
«St||¬ «S) uo Return the localized display name for the given timezone. The timezone
may be specified using a ``datetime`` or `tzinfo` object.
>>> from datetime import time
>>> dt = time(15, 30, tzinfo=get_timezone('America/Los_Angeles'))
>>> get_timezone_name(dt, locale='en_US') # doctest: +SKIP
'Pacific Standard Time'
>>> get_timezone_name(dt, locale='en_US', return_zone=True)
'America/Los_Angeles'
>>> get_timezone_name(dt, width='short', locale='en_US') # doctest: +SKIP
'PST'
If this function gets passed only a `tzinfo` object and no concrete
`datetime`, the returned display name is independent of daylight savings
time. This can be used for example for selecting timezones, or to set the
time of events that recur across DST changes:
>>> tz = get_timezone('America/Los_Angeles')
>>> get_timezone_name(tz, locale='en_US')
'Pacific Time'
>>> get_timezone_name(tz, 'short', locale='en_US')
'PT'
If no localized display name for the timezone is available, and the timezone
is associated with a country that uses only a single timezone, the name of
that country is returned, formatted according to the locale:
>>> tz = get_timezone('Europe/Berlin')
>>> get_timezone_name(tz, locale='de_DE')
'Mitteleuropäische Zeit'
>>> get_timezone_name(tz, locale='pt_BR')
'Horário da Europa Central'
On the other hand, if the country uses multiple timezones, the city is also
included in the representation:
>>> tz = get_timezone('America/St_Johns')
>>> get_timezone_name(tz, locale='de_DE')
'Neufundland-Zeit'
Note that short format is currently not supported for all timezones and
all locales. This is partially because not every timezone has a short
code in every locale. In that case it currently falls back to the long
format.
For more information see `LDML Appendix J: Time Zone Display Names
<https://www.unicode.org/reports/tr35/#Time_Zone_Fallback>`_
.. versionadded:: 0.9
.. versionchanged:: 1.0
Added `zone_variant` support.
:param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines
the timezone; if a ``tzinfo`` object is used, the
resulting display name will be generic, i.e.
independent of daylight savings time; if `None`, the
current date in UTC is assumed
:param width: either "long" or "short"
:param uncommon: deprecated and ignored
:param zone_variant: defines the zone variation to return. By default the
variation is defined from the datetime object
passed in. If no datetime object is passed in, the
``'generic'`` variation is assumed. The following
values are valid: ``'generic'``, ``'daylight'`` and
``'standard'``.
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
:param return_zone: True or False. If true then function
returns long time zone ID
ÚgenericÚdaylightÚstandard)zInvalid zone variationr…rrrrd©rW)r4r
rRrr9ÚdstÚ
ValueErrorr r“r”ÚNO_INHERITANCE_MARKERr)r3rUÚuncommonrWÚ zone_variantÚ return_zoner#rr6r™ÚvaluerŸr Únames r$Úget_timezone_namer¯5sô\$ 1J€BˆÜ
\‰\˜+¤GÓ
,€Fä ˜ Ó %€DàÐØ
ˆ:Ø$‰Là—*‘*˜R“.ˆCÙ),™:°*‰Là Ð Ð   )¨$°Ó 5€DÙØˆ Ø × Ñ × Ñ   rÓ *€Dà ¨¨e©ÑU‘ ˜LÑØ Ô ˆLä˜+¨DÓ1€HÙØ×-¨h¸Ó
Ø    Ñ+¨LÓ9ˆ˜Ò DÔ,AÒ$Að°ÓÓFÙ˜Ô 5Ò ð
€~Ü ¨%¸Ô  °fÔ =r&có.|tjj«}n*t|tj«r|j«}t j
|xst «}|dvr
t||¬«}t|«}|j||«S)Return a date formatted according to the given pattern.
>>> from datetime import date
>>> d = date(2007, 4, 1)
>>> format_date(d, locale='en_US')
'Apr 1, 2007'
>>> format_date(d, format='full', locale='de_DE')
'Sonntag, 1. April 2007'
If you don't want to use the locale default formats, you can specify a
custom date pattern:
>>> format_date(d, "EEE, MMM d, ''yy", locale='en')
"Sun, Apr 1, '07"
:param date: the ``date`` or ``datetime`` object; if `None`, the current
date is used
:param format: one of "full", "long", "medium", or "short", or a custom
date/time pattern
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
r)
r(r>r?r+r
rRrrjÚ
parse_patternÚapply)r>rrWrs r$Ú format_dater³±syð4 €|Ü}‰}×$‰Ü Dœ(×+Ô ,Øy‰yä
\‰\˜+¤GÓ
,€FØ
Ð  °ÔܘFÓ#€GØ =‰=˜˜ &r&c óPtt|«|«}tj|xst«}|dvrVt ||¬«j
dd«j
dt||d|¬««j
dt|||¬««St|«j||«S) uReturn a date formatted according to the given pattern.
>>> from datetime import datetime
>>> dt = datetime(2007, 4, 1, 15, 30)
>>> format_datetime(dt, locale='en_US')
'Apr 1, 2007, 3:30:00\u202fPM'
For any pattern requiring the display of the timezone:
>>> format_datetime(dt, 'full', tzinfo=get_timezone('Europe/Paris'),
... locale='fr_FR')
'dimanche 1 avril 2007, 17:30:00 heure d’été d’Europe centrale'
>>> format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz",
... tzinfo=get_timezone('US/Eastern'), locale='en')
'2007.04.01 AD at 11:30:00 EDT'
:param datetime: the `datetime` object; if `None`, the current date and
time is used
:param format: one of "full", "long", "medium", or "short", or a custom
date/time pattern
:param tzinfo: the timezone to apply to the time for display
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
rúú{0}N©rrWú{1}) rCr1r
rRrror Ú format_timer³)r(rrrWs r$Úformat_datetimer»×sô:'¤}°XÓ'>ÀÓG€Hä
\‰\˜+¤GÓ
,€FØ
Ð  ¨vÔ
‰WS˜
ß
‰WUœK¨°&ÀÈfÔ
‰WUœK¨°&ÀÔ

ô˜$×*¨8°VÓ<r&cót|tj«r|j«nd}t||«}t j
|xst «}|dvr
t||¬«}t|«j|||¬«S)Return a time formatted according to the given pattern.
>>> from datetime import datetime, time
>>> t = time(15, 30)
>>> format_time(t, locale='en_US')
'3:30:00\u202fPM'
>>> format_time(t, format='short', locale='de_DE')
'15:30'
If you don't want to use the locale default formats, you can specify a
custom time pattern:
>>> format_time(t, "hh 'o''clock' a", locale='en')
"03 o'clock PM"
For any pattern requiring the display of the time-zone a
timezone has to be specified explicitly:
>>> t = datetime(2007, 4, 1, 15, 30)
>>> tzinfo = get_timezone('Europe/Paris')
>>> t = _localize(tzinfo, t)
>>> format_time(t, format='full', tzinfo=tzinfo, locale='fr_FR')
'15:30:00 heure d’été d’Europe centrale'
>>> format_time(t, "hh 'o''clock' a, zzzz", tzinfo=get_timezone('US/Eastern'),
... locale='en')
"09 o'clock AM, Eastern Daylight Time"
As that example shows, when this function gets passed a
``datetime.datetime`` value, the actual time in the formatted string is
adjusted to the timezone specified by the `tzinfo` parameter. If the
``datetime`` is "naive" (i.e. it has no associated timezone information),
it is assumed to be in UTC.
These timezone calculations are **not** performed if the value is of type
``datetime.time``, as without date information there's no way to determine
what a given time would translate to in a different timezone without
information about whether daylight savings time is in effect or not. This
means that time values are left as-is, and the value of the `tzinfo`
parameter is only used to display the timezone name if needed:
>>> t = time(15, 30)
>>> format_time(t, format='full', tzinfo=get_timezone('Europe/Paris'),
... locale='fr_FR') # doctest: +SKIP
'15:30:00 heure normale d\u2019Europe centrale'
>>> format_time(t, format='full', tzinfo=get_timezone('US/Eastern'),
... locale='en_US') # doctest: +SKIP
'3:30:00\u202fPM Eastern Standard Time'
:param time: the ``time`` or ``datetime`` object; if `None`, the current
time in UTC is used
:param format: one of "full", "long", "medium", or "short", or a custom
date/time pattern
:param tzinfo: the time-zone to apply to the time for display
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
Nr)Úreference_date)
r+r(r>rFr
rRrrr)r0rrrWÚref_dates r$srô@¬x×/@Ñ/@ÔAˆty‰yŒ{Àt€Hä T˜ "€Dä
\‰\˜+¤GÓ
,€FØ
Ð  °ÔÜ ˜Ó × & t¨VÀHÐ Mr&cóÂtj|xst«}|r$||jvrt ||j«}|j|}t ||||«S)Return a time and/or date formatted according to the given pattern.
The skeletons are defined in the CLDR data and provide more flexibility
than the simple short/long/medium formats, but are a bit harder to use.
The are defined using the date/time symbols without order or punctuation
and map to a suitable format for the given locale.
>>> from datetime import datetime
>>> t = datetime(2007, 4, 1, 15, 30)
>>> format_skeleton('MMMEd', t, locale='fr')
'dim. 1 avr.'
>>> format_skeleton('MMMEd', t, locale='en')
'Sun, Apr 1'
>>> format_skeleton('yMMd', t, locale='fi') # yMMd is not in the Finnish locale; yMd gets used
'1.4.2007'
>>> format_skeleton('yMMd', t, fuzzy=False, locale='fi') # yMMd is not in the Finnish locale, an error is thrown
Traceback (most recent call last):
...
KeyError: yMMd
>>> format_skeleton('GH', t, fuzzy=True, locale='fi_FI') # GH is not in the Finnish locale and there is no close match, an error is thrown
Traceback (most recent call last):
...
KeyError: None
After the skeleton is resolved to a pattern `format_datetime` is called so
all timezone processing etc is the same as for that.
:param skeleton: A date time skeleton as defined in the cldr data.
:param datetime: the ``time`` or ``datetime`` object; if `None`, the current
time in UTC is used
:param tzinfo: the time-zone to apply to the time for display
:param fuzzy: If the skeleton is not found, allow choosing a skeleton that's
close enough to it. If there is no close match, a `KeyError`
is thrown.
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
)r
rRrÚdatetime_skeletonsÚmatch_skeletonr»)Úskeletonr(rÚfuzzyrWrs r$Úformat_skeletonrÄLs[ôV\‰\˜+¤GÓ
,€FÙ  ×!:Ñ!:Ñ! (¨F×,EÑ,EÓFˆØ
×
& 
0€FÜ ˜8 V¨V°VÓ <r&))Úyeari€3á)Úmonthi')Úweeki€: )Údayé€Q)Úhourrv)Úminuteru)ÚsecondrŠztuple[tuple[str, int], ...]ÚTIMEDELTA_UNITScóö
dvr td«dk(rtjdtd¬«dŠt |t
j «r&t|jdz|jz«Šn|Štj|xst«}|jd Š
|jd
Šˆˆ
ˆˆˆfd }tD\}}t«|z } | |k\s||k(sŒ||k(r| d kDr t!d
| «} tt#| ««} |j%| «}
d} ||«D]-} | Œ| j'|
«xs| j'd«} | sŒ-n| y| j)dt+| ««cSy)a
Return a time delta according to the rules of the given locale.
>>> from datetime import timedelta
>>> format_timedelta(timedelta(weeks=12), locale='en_US')
'3 months'
>>> format_timedelta(timedelta(seconds=1), locale='es')
'1 segundo'
The granularity parameter can be provided to alter the lowest unit
presented, which defaults to a second.
>>> format_timedelta(timedelta(hours=3), granularity='day', locale='en_US')
'1 day'
The threshold parameter can be used to determine at which value the
presentation switches to the next higher unit. A higher threshold factor
means the presentation will switch later. For example:
>>> format_timedelta(timedelta(hours=23), threshold=0.9, locale='en_US')
'1 day'
>>> format_timedelta(timedelta(hours=23), threshold=1.1, locale='en_US')
'23 hours'
In addition directional information can be provided that informs
the user if the date is in the past or in the future:
>>> format_timedelta(timedelta(hours=1), add_direction=True, locale='en')
'in 1 hour'
>>> format_timedelta(timedelta(hours=-1), add_direction=True, locale='en')
'1 hour ago'
The format parameter controls how compact or wide the presentation is:
>>> format_timedelta(timedelta(hours=3), format='short', locale='en')
'3 hr'
>>> format_timedelta(timedelta(hours=3), format='narrow', locale='en')
'3h'
:param delta: a ``timedelta`` object representing the time difference to
format, or the delta in seconds as an `int` value
:param granularity: determines the smallest unit that should be displayed,
the value can be one of "year", "month", "week", "day",
"hour", "minute" or "second"
:param threshold: factor that determines at which point the presentation
switches to the next higher unit
:param add_direction: if this flag is set to `True` the return value will
include directional information. For instance a
positive timedelta will include the information about
it being in the future, a negative will be information
about the value being in the past.
:param format: the format, can be "narrow", "short" or "long". (
"medium" is deprecated, currently converted to "long" to
maintain compatibility)
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
)Únarrowrrrz1Format must be one of "narrow", "short" or "long"rzU"medium" value for format param of format_timedelta is deprecated. Use "long" insteadé)ÚcategoryÚ
stacklevelrÚ date_fieldsÚ
unit_patternsc3óøKr1‰j|d«xs|}dk\r|dn|dd|}j|i«}|j«dvr|jd«yy­w)-rÚfutureÚpastz duration-)rr)r“)Úa_unitÚunit_rel_patternsÚ unit_patsÚ
add_directionrÓrr|s €€€€€r$Ú_iter_patternsz(format_timedelta.<locals>._iter_patternsáøèø€Ù ð!,§¡°6°(¸!¸F¸8Ð0DÓ EÒ \ÈÐU[ÑI\Рؘ!Š|ØÑјV˜Ø% f¨bÓ1ˆ Øm‰m˜
Ð —-- Ó  (ùsƒA7A:rotherr¶)Ú TypeErrorÚwarningsÚwarnÚDeprecationWarningr+r(Ú timedeltar.rZr|r
rRrÚ_datarÍÚabsÚmaxÚroundÚ plural_formr“r r,)ÚdeltaÚ granularityÚ thresholdrÜrrWÚunitÚ
secs_per_unitr­rrnr|s `` @@@r$Úformat_timedeltarîsxü€ðNÐÐ
ÒÜ
Ø õ
ð
ˆÜ×u—z‘z EÑ)¨U¯]©]Ñ;‰àˆÜ
\‰\˜+¤GÓ
,€FØ—,‘,˜}Ñ-€KØ—L‘L Ñ1€M÷)ô&ˆˆG“ ˜}ÑØ   ¨Ó!4Ø" u¨q¢yܘA˜u
Üœ˜e› Ó%ˆEØ ×,¨UÓ3ˆK؈GÙ*¨4Ó
ØÑ&Ÿl™l¨;ÓP¸8¿<¹<ÈÓ;PÙð 
ð ˆÙØ—?‘? 5¬#¨e«*Ó 5ð!6ð$ r&có\jvrˆˆˆfd}n;td||fD««rˆfd}n!td||fD««rˆˆfd}nˆˆfd}||«}||«}||k(r||«Sjjdd«j d|«j d |«S)
Ncó"t|¬«S©Nr¦))r#rWrs €€€r$ú<lambda>z+_format_fallback_interval.<locals>.<lambda>sø€œO¨H°b¸ÔP€r&c3óŠK|];}t|tj«xrt|tj« Œ=y­w©N)r+r(r>©Ú.0Úds r$ú <genexpr>z,_format_fallback_interval.<locals>.<genexpr>s=èø€ò
ð
ô
A”x—}}Ó %Ò N¬j¸¼H×<MÑ<MÓ.NÐ*NÓ Nñ
ùó‚AAcót|¬«S))r#rWs €r$z+_format_fallback_interval.<locals>.<lambda>sø€œK¨°6Ô:€r&c3óŠK|];}t|tj«xrt|tj« Œ=y­w)r+r(r0r>s r$z,_format_fallback_interval.<locals>.<genexpr>s;èø€ò
ð
ô
A”x—}}Ó %Ò J¬j¸¼H¿M¹MÓ.JÐ*JÓ Jñ
ùrùcó t|¬«S©Nr¸)©r#rWrs €€r$z+_format_fallback_interval.<locals>.<lambda>sø€œK¨°6À&ÔI€r&có t|¬«S)s €€r$z+_format_fallback_interval.<locals>.<lambda>sø€œO¨B°vÀfÔM€r&z{0}-{1}r·)ÚallÚinterval_formatsr“r )ÚstartÚendrÂrrWrÚformatted_startÚ
formatted_ends ``` r$Ú_format_fallback_intervalr ú€ðP‰Ü ñ
ð˜ô
ô
ó
;‰Ü ñ
ð˜ô
ô
ô
Jäá˜U“m€OÙ˜3“K€Mà˜-Òe‹}Ðð ×Ñ×# D¨)Ó˜Ó (ß ˜
Ó &ðr&c óDtjxst«Šj}||vs|s$|r|r
t ||«}nd}|st ||||«S||}||k(rt
||||¬«Stt|«|¬«}tt|«|¬«}t|¬«}t|¬«} tD]U}
|
|vsŒ|j|
«| j|
«k7sŒ,djˆfdt||
||f«D««cSt ||||«S)u)
Format an interval between two instants according to the locale's rules.
>>> from datetime import date, time
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "yMd", locale="fi")
'15.–17.1.2016'
>>> format_interval(time(12, 12), time(16, 16), "Hm", locale="en_GB")
'12:12–16:16'
>>> format_interval(time(5, 12), time(16, 16), "hm", locale="en_US")
'5:12\u202fAM\u2009–\u20094:16\u202fPM'
>>> format_interval(time(16, 18), time(16, 24), "Hm", locale="it")
'16:18–16:24'
If the start instant equals the end instant, the interval is formatted like the instant.
>>> format_interval(time(16, 18), time(16, 18), "Hm", locale="it")
'16:18'
Unknown skeletons fall back to "default" formatting.
>>> format_interval(date(2015, 1, 1), date(2017, 1, 1), "wzq", locale="ja")
'2015/01/01~2017/01/01'
>>> format_interval(time(16, 18), time(16, 24), "xxx", locale="ja")
'16:18:00~16:24:00'
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de")
'15.01.2016\u2009–\u200917.01.2016'
:param start: First instant (datetime/date/time)
:param end: Second instant (datetime/date/time)
:param skeleton: The "skeleton format" to use for formatting.
:param tzinfo: tzinfo to use (if none is already attached)
:param fuzzy: If the skeleton is not found, allow choosing a skeleton that's
close enough to it.
:param locale: A locale object or identifier. Defaults to the system time locale.
:return: Formatted interval
N)rWrc3óZK|]"\}}t|«j|«Œ$y­w))rr@rWs €r$z"format_interval.<locals>.<genexpr>Œs/øèø€òá$G˜Wô˜gÓ&×,¨W°f×ùsƒ(+)r
rRrrrrCr1ÚDateTimeFormatÚPATTERN_CHAR_ORDERÚextractÚjoinÚzip) rrrrWrÚ skel_formatsÚ start_fmtÚend_fmtÚfields ` r$Úformat_intervalr.s9ø€ôb\‰\˜+¤GÓ
,€Fð×àÐ'©xñ Ü% hÐ0@ÓA‰HàˆHÙä,¨U°C¸À6È6Ó # HÑ-€Là ‚|ܘx¨°¸eÈFÔ #¤M°%Ó$8ÀÔ H€EÜ
!¤-°Ó"4¸
D€Cä˜u¨VÔ4€IܘS¨Ô0€GôˆØ   Y×%6Ñ%6°uÓ%=ÀÇÁÐQVÓAWÓ%Wð—7‘7óä(+¨L¸Ñ,?À%ÈÀÓ(Nôóò
ð ô % U¨C°¸6À6Ó Jr&cóÈt||«}t|jdzdz|jdzz|jz«}t j |xst«}|jj|i«j«}|D]\}}|D]}d|vsŒ|d|k(sŒ|ccSŒ!|D\}}|D}d|vrPd|vrL|d|dkr|d|cxkr|dkr0nn-|ccS|d|cxkrdksnd|cxkr|dkr nn|ccSdx} }
d|vr
||dk\rd} d |vr
||d krd}
d|vr
||dkrd}
d
|vr td «| sŒ—|
sŒš|ccSŒª|d kry
y)u
Get the day period ID for a given time.
This ID can be used as a key for the period name dictionary.
>>> from datetime import time
>>> get_period_names(locale="de")[get_period_id(time(7, 42), locale="de")]
'Morgen'
>>> get_period_id(time(0), locale="en_US")
'midnight'
>>> get_period_id(time(0), type="selection", locale="en_US")
'morning1'
:param time: The time to inspect.
:param tzinfo: The timezone for the time. See ``format_time``.
:param type: The period type to use. Either "selection" or None.
The selection type is used for selecting among phrases such as
“Your email arrived yesterday evening†or “Your email arrived last nightâ€.
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
:return: period ID. Something is always returned -- even if it's just "am" or "pm".
ruÚatÚfromÚbeforerÉrFTÚtoÚafterz$'after' is deprecated as of CLDR 29.iÀ¨ÚamÚpm) rFr.r
rRrÚday_period_rulesr“ÚitemsÚNotImplementedError) r0rÚtyperWÚseconds_past_midnightÚrulesetsÚrule_idÚrulesÚruleÚstart_okÚend_oks r$Ú
get_period_idr&ô: T˜ "€DÜ § ¡ ¨B¡°Ñ 3°d·k±kÀBÑ6FÑ FÈÏÉÑ TÓÜ
\‰\˜+¤GÓ
,€Fð×&×*¨4°Ó4×<€HàˆØò ˆDØtŠ|  T¡
Ð.CÓ CØñ ðð
ˆØò ˆ˜‰~ (¨dÑ"2ؘ< $ x¡.Ò˜F|Ð'<ÔM¸tÀH¹~Õð˜V™ Ð(=ÔÔÐ 5Ô¸X¹Õà %Ð %ˆH˜‰~Ð"7¸¹<Ò"GØØt‰|Ð 5¸¸d¹Ò Cðؘ4ÑÐ$9¸DÀ¹NÒ$JØØ˜$‰Ü)Ð*PÓšFØñ7 ðð<˜àr&có eZdZy)Ú
ParseErrorN)Ú__name__Ú
__module__Ú __qualname__©r&r$r(r(äsØr&r(cóvtjd|«}|s td«|dv}tjd|tj¬«}|r1|r/ t j tt|j««ŽS|rt||¬«}n t|«}|jj«}|jd«}|j!d«} | d kr|jd
«} |jd «}
t#|d f| d
f|
dfg«} t%| «D
cic] \} }
|
d| Œ
} } }
|| d }t'|«dk(rdt|«zn
t|«}t|| d
«}t|| d«}|dkDr||}}t j |||«S#t$rYŒ0wxYwcc}
} w)aParse a date from a string.
If an explicit format is provided, it is used to parse the date.
>>> parse_date('01.04.2004', format='dd.MM.yyyy')
datetime.date(2004, 4, 1)
If no format is given, or if it is one of "full", "long", "medium",
or "short", the function first tries to interpret the string as
ISO-8601 date format and then uses the date format for the locale
as a hint to determine the order in which the date fields appear in
the string.
>>> parse_date('4/1/04', locale='en_US')
datetime.date(2004, 4, 1)
>>> parse_date('01.04.2004', locale='de_DE')
datetime.date(2004, 4, 1)
>>> parse_date('2004-04-01', locale='en_US')
datetime.date(2004, 4, 1)
>>> parse_date('2004-04-01', locale='de_DE')
datetime.date(2004, 4, 1)
>>> parse_date('01.04.04', locale='de_DE', format='short')
datetime.date(2004, 4, 1)
:param string: the string containing the date
:param locale: a `Locale` object or a locale identifier
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
:param format: the format to use, either an explicit date format,
or one of "full", "long", "medium", or "short"
(see ``get_time_format``)
ú(\d+)úNo numbers were found in inputrz^(\d{4})-?([01]\d)-?([0-3]\d)$)ÚflagsriÚmrÚlr÷ÚDrŠé )ÚreÚfindallr(ÚmatchÚASCIIr(r>Úmapr.Úgroupsr¨rjrÚlowerÚindexÚfindÚsortedÚ enumerater)ÚstringrWrÚnumbersÚuse_predefined_formatÚ iso_alikeÚfmtÚ
format_strÚyear_idxÚ month_idxÚday_idxÚindexesÚidxÚitemrÅs r$Ú
parse_daterOèôHj‰j˜ 6Ó*€GÙ ÜÐ"Ð&IÐôØÜh‰hô€Iñ
Ñ Ü—==¤#¤c¨9×+;Ñ+;Ó+=Ó">Ð Ü V°FÔ;‰ä˜FÓØ×$€JØ×Ñ Ó$€HØ Ó$€IØ1‚}Ø×$ SÓ)ˆ Ø×јsÓ#€Gäx o¨ °3Ð'7¸'À3¸ÐI€GÜ-6°wÓ-?×  TˆtA‰w˜‰|Ð@€GÑ
7˜3 €DÜ" 4y¨Aš~ˆ4”#d“)Ò ´3°t³9€DÜ ˜  Ñ &€EÜ
ˆgg˜c
$€CØ ˆr‚zؘ%ˆsˆÜ =‰=˜˜u cÓ *øô5ò Ú ð üóAsÁ-F%Ä!F5Æ% F2Æ1F2cóötjd|«}|s td«|dvrt||¬«}n t |«}|j
j
«}|jd«}|dkr|jd«}|jd«}|jd «x}dkrtj}t|d
f|d f|d fg«} t| «D
cic] \}
} | d
|
Œ
} }
} d} d|vrd|j
«vrd} dx}
}t|| d
«| z}t|«d
kDr0t|| d «}
t|«dkDrt|| d «}tj ||
|«Scc} }
w)aParse a time from a string.
This function uses the time format for the locale as a hint to determine
the order in which the time fields appear in the string.
If an explicit format is provided, the function will use it to parse
the time instead.
>>> parse_time('15:30:00', locale='en_US')
datetime.time(15, 30)
>>> parse_time('15:30:00', format='H:mm:ss')
datetime.time(15, 30)
:param string: the string containing the time
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
:param format: the format to use, either an explicit time format,
or one of "full", "long", "medium", or "short"
(see ``get_time_format``)
:return: the parsed time
:rtype: `time`
r.r/rriÚhrÚkr2ÚHr5ÚSrŠÚarr7)r8r9r(rrrr>r@r?ÚmathÚinfrArBr.rr(r0)rCrWrrDrGrHÚhour_idxÚmin_idxÚsec_idxrLrMrNÚ hour_offsetrËs r$Ú
parse_timer]8s‡ô4j‰j˜ 6Ó*€GÙ ÜÐРV°FÔ;‰ä˜FÓØ×$€Jؘ#€HØ!‚|Ø×# CÓØ×јsÓ#€Gà—?? 'ˆ¨1Ò—(ä° ~¸À°~ÐG€GÜ-6°wÓ-?×  TˆtA‰w˜‰|Ð@€GÑ €KØ
ˆjјT V§\¡\£^ш ðЀFˆVÜ ˆww˜s‘|Ñ Ñ 3€DÜ
ˆ7ƒ|ÜW˜W S™\ÑÜ ˆw‹<˜!Ò Ü˜ ¨¡Ñ/ˆFÜ =‰=˜˜v  .ùó#AsÃE5cóFeZdZddZddZddZd dZ d
d dZy) rfcó ||_||_y)rr)Úselfrrs r$Ú__init__zDateTimePattern.__init__zs؈Œ ؈ r&cóNdt|«jd|jdS)<rú>)rr)r©r`s r$Ú__repr__zDateTimePattern.__repr__~s'Ø”4˜“:×' ¯©Ð(8¸Ð:r&có|j}|S©r)r`Úpats r$Ú__str__zDateTimePattern.__str__sØl‰lˆØˆ
r&cóLt|t«stS|j|zS)r+r ÚNotImplementedr)r`s r$Ú__mod__zDateTimePattern.__mod__…s!Ü˜Ô {‰{˜"r&Ncó"|t|||«zS)r )r`r(rWs r$zDateTimePattern.applyŠsð ”n X¨v°~ÓFr&)rr,rr ©Úreturnr,)r rpr,)r(údatetime.date | datetime.timerWúLocale | str | Noner½údatetime.date | Nonerpr,)r)r*r+rarfrjrmr,r&r$rfrfysKóóó04ð GàGðGðGð
ô Gr&cóÂeZdZ d ddZddZddZddZddZddZddZ dd „Z
ddd
Z dd Z dd Z
dd
ZddZdZddZddZdddZd dZd dZdd!dZy)"r Ncóbt|tjtjtjf«sJt|tjtjf«r"|j|j t ¬«}||_tj|«|_
||_ y)Nr) r+r(r>r0rr r/r­r
rRrW)r`r­rWs r$razDateTimeFormat.__init__”szô ˜%¤(§-¡-´×1BÑ1BÄHÇMÁMÐ!RÔ eœh×·±Ð @ÀUÇ\Á\ÐEYØ—M‘M¬-ˆE؈Œ
Ü—l‘l 6Ó*ˆŒ Ø,ˆÕr&cóf|d}t|«}|dk(r|j||«S|dvr|j||«S|dvr|j||«S|dvr|j ||«S|dvr|j ||«S|dk(r&|j
|jj|«S|dk(r|j|«S|d k(r|j«S|d
vr|j||«S|d vr|j||«S|d k(rW|jjd
zdk(r|j
d
|«S|j
|jjd
z|«S|dk(r&|j
|jj|«S|dk(r)|j
|jjd
z|«S|dk(rQ|jjdk(r|j
d|«S|j
|jj|«S|dk(r&|j
|jj|«S|dk(r&|j
|jj|«S|dk(r|j!|«S|dk(r|j#|«S|dvr|j%||«St'd|«)NrÚG)r1r4ÚÚr5ÚL)ÚWr÷r6ÚF)ÚErOÚc)rVÚBrQr7rTÚKrRrtr2rSrUÚA)ÚzrwÚOzUnsupported date/time field )rÚ
format_eraÚ format_yearÚformat_quarterÚ format_monthÚ format_weekrr­Úformat_day_of_yearÚformat_day_of_week_in_monthÚformat_weekdayÚ
format_periodrÊÚformat_frac_secondsÚformat_milliseconds_in_dayÚformat_timezoneÚKeyError)r`ÚcharÚnums r$Ú __getitem__zDateTimeFormat.__getitem__¡sØA‰wˆÜ$‹iˆØ 3Š;Ø—?‘? 4¨Ó

×# D¨#Ó

Ø×& t¨SÓ

Ø×$ T¨3Ó

Ø×# D¨#Ó
SŠ[Ø—;‘;˜tŸz™zŸ~™~¨sÓ
SŠ[Ø×*¨3Ó
SŠ[Ø×

×& t¨SÓ

×% d¨CÓ
SŠ[Øz‰z Ñ# —{{ 2 —{{ 4§:¡:§?¡?°RÑ#7¸Ó
SŠ[Ø—;‘;˜tŸz™zŸ°Ó
SŠ[Ø—;‘;˜tŸz™zŸ°Ñ3°SÓ
SŠ[Øz‰z —{{ 2 sÓ—{{ 4§:¡:§?¡?°CÓ
SŠ[Ø—;‘;˜tŸz™z×0°#Ó
SŠ[Ø—;‘;˜tŸz™z×0°#Ó
SŠ[Ø×+¨CÓ
SŠ[Ø×2°3Ó
Ð
רcÓ Ð9¸$¸Ð Cr&cóôt|«d}|dk(r|jjS|dk(r|jjS|dk(r|jjS|dk(r|jj
S|dk(r|jj
dzxsdS|dk(r|jj S|d k(r"t|jj
dk\«Std
|d |j«) Nrr1r5rTrQr7r2rVzNot implemented: extracting z from ) r,r­r.r)r`s r$r zDateTimeFormat.extractÓÜ4‹y˜‰|ˆØ 3Š;Ø—::—?
SŠ[Ø—:‘:×
SŠ[Ø—::—>
SŠ[Ø—::—?
SŠ[Ø—::—?? -¨2Ð
SŠ[Ø—:‘:×
SŠ[Üt—zz—¨"Ñ .¨t¨h°f¸T¿Z¹Z¸NÐð
r&cóžddddœtd|«}t|jjdk\«}t ||j
«|S) abbreviatedÚwiderÏ©ééér)r.r­rerW)r`rrUÚeras r$rzDateTimeFormat.format_eraèsFØ! Ñ:¼3¸qÀ#»;ÑGˆÜ$—**—// 'ˆÜ˜U D§K¡KÓÑ5r&có|jj}|j«rƒ|jj}|dk(r2|jjdkr|j «dk\r|dz}n6|dk(r1|jjdkDr|j «dkr|dz
}|j
||«}|dk(r|dd}|S)NrŠéé4r7ééþÿÿÿ)r­ÚisupperrÆÚget_week_of_yearr)r`rr­s r$zDateTimeFormat.format_yearíØ
ˆØ <‰<Œ>Ø—JJ×$ˆ˜Šz˜dŸj™jŸn™n¨qÒ0°T×5JÑ5JÓ5LÐPRÒ5Rؘ
ؘ" §¡§¡°"Ò!4¸×9NÑ9NÓ9PÐTUÒ9Uؘ
Ø{‰{˜5 &ˆØ !Š8ؘ˜9ˆˆ r&có®|jjdz
dzdz}|dkrd||fzSddddœ|}d d
d œ|}t|||j«|S) NrŠú%0*drŸr rrry)r­rarW)r`rÚquarterrUrVs r$rzDateTimeFormat.format_quarterúsnØ—::×# '¨AÑÑ1ˆØ !Š8ؘS '˜ ! Ñ:¸Ø  }Ñ5°dÑÜ  ¨°·±Ó=¸Fr&cóÀ|dkrd||jjfzSddddœ|}ddd œ|}t|||j«|jjS)
NrÐr rrr|)r­r^rW)r`rrUrVs r$rzDateTimeFormat.format_monthseØ !Š8ؘS $§*¡*×"2Ñ"2Ð ! Ñ:¸3ÑØ  }Ñ5°dÑܘu g¨t¯{©{Ó;¸D¿J¹J×<LÑ<LÑMr&cóœ|j«r"|j«}|j||«S|j«}t |«S)Úislowerr¬rÚget_week_of_monthr,)r`rs r$rzDateTimeFormat.format_week sBØ <‰<Œ>Ø×*ˆ—;‘;˜t SÓ ×+ˆt“9Ð r&cóV|dkr^|j«rLd|jjz
|jj «z}|j |dzdz|«Sd}|jj «}dddddœ|}|d k(rd
nd }t
|||j«|S) a
Return weekday from parsed datetime according to format pattern.
>>> from datetime import date
>>> format = DateTimeFormat(date(2016, 2, 28), Locale.parse('en_US'))
>>> format.format_weekday()
'Sunday'
'E': Day of week - Use one through three letters for the abbreviated day name, four for the full (wide) name,
five for the narrow name, or six for the short name.
>>> format.format_weekday('E',2)
'Sun'
'e': Local day of week. Same as E except adds a numeric value that will depend on the local starting day of the
week, using one or two letters. For this example, Monday is the first day of the week.
>>> format.format_weekday('e',2)
'01'
'c': Stand-Alone local day of week - Use one letter for the local numeric value (same as 'e'), three for the
abbreviated day name, four for the full (wide) name, five for the narrow name, or six for the short name.
>>> format.format_weekday('c',1)
'1'
:param char: pattern format character ('e','E','c')
:param num: count of format character
r r)érrr)rWÚfirst_week_dayr­Úweekdayrr[)r`rr­rUrVs r$r”zDateTimeFormat.format_weekdayð8 Š7Ø|‰|Œ~ؘDŸK™K׿¹×9KÑ9KÓ9MÑMØ—{{ 5¨1¡9¨q¡=°#Óˆ—**×&ˆØ! ¸FÀsÑKˆØ#'¨3¢;-°HˆÜ˜U G¨T¯[©[Ó9¸Br&cóB|j|j«|«S)rÚget_day_of_year)r`rs r$rz!DateTimeFormat.format_day_of_year7sØ{‰{˜4×1°3Ó7r&cóRt|jjdz
dzdz«S)NrŠ)r,r­res r$r“z*DateTimeFormat.format_day_of_week_in_month:s$ÜD—JJ—NN &¨1Ñ,¨qÑ1r&cóXddddœtd|«dddg}|dk(r |jjdk\rdnd }d
}n*t|j|j¬ «}|d k(rd
nd
}|D]%}t |||j¬«}||vsŒ ||cSt
d|d|j«)u
Return period from parsed datetime according to format pattern.
>>> from datetime import datetime, time
>>> format = DateTimeFormat(time(13, 42), 'fi_FI')
>>> format.format_period('a', 1)
'ip.'
>>> format.format_period('b', 1)
'iltap.'
>>> format.format_period('b', 4)
'iltapäivä'
>>> format.format_period('B', 4)
'iltapäivällä'
>>> format.format_period('B', 5)
'ip.'
>>> format = DateTimeFormat(datetime(2022, 4, 28, 6, 27), 'zh_Hant')
>>> format.format_period('a', 1)
'上åˆ'
>>> format.format_period('B', 1)
'清晨'
:param char: pattern format character ('a', 'b', 'B')
:param num: count of format character
r rVr7rrrr„r)rVrUrWzCould not format period z in )r­r&rWrX)r`rÚwidthsÚperiodrVrUÚ period_namess r$r•zDateTimeFormat.format_period=ð8 &¨XÑ 6´s¸1¸c³{Ñ Ø Ø ð 
ˆð 3Š;Ø!ŸZ™ZŸ_™_°Ò2T¸ˆ‰Gä" 4§:¡:°d·k±kÔBˆFØ"&¨#¢+h°=ˆò ,ˆ+°GÀ5ÐQU×Q\ÑQ\Ô]ˆ˜Ò# FÑÐ3°F°8¸4ÀÇ Á ¸Nr&cóx|jjdz }|jt||«d|zz|«S)zŽ Return fractional seconds.
Rounds the time's microseconds to the precision given by the number of digits passed in.
i@Bé
)r­Ú microsecondr)r`rr­s r$rz"DateTimeFormat.format_frac_secondsjs9ð