Arrow: Better dates & times for Python¶
Release v1.0.0 (Installation) (Changelog)
Arrow is a Python library that offers a sensible and human-friendly approach to creating, manipulating, formatting and converting dates, times and timestamps. It implements and updates the datetime type, plugging gaps in functionality and providing an intelligent module API that supports many common creation scenarios. Simply put, it helps you work with dates and times with fewer imports and a lot less code.
Arrow is named after the arrow of time and is heavily inspired by moment.js and requests.
Why use Arrow over built-in modules?¶
Python’s standard library and some other low-level modules have near-complete date, time and timezone functionality, but don’t work very well from a usability perspective:
Too many modules: datetime, time, calendar, dateutil, pytz and more
Too many types: date, time, datetime, tzinfo, timedelta, relativedelta, etc.
Timezones and timestamp conversions are verbose and unpleasant
Timezone naivety is the norm
Gaps in functionality: ISO 8601 parsing, timespans, humanization
Features¶
Fully-implemented, drop-in replacement for datetime
Support for Python 3.6+
Timezone-aware and UTC by default
Super-simple creation options for many common input scenarios
shift
method with support for relative offsets, including weeksFormat and parse strings automatically
Wide support for the ISO 8601 standard
Timezone conversion
Support for
dateutil
,pytz
, andZoneInfo
tzinfo objectsGenerates time spans, ranges, floors and ceilings for time frames ranging from microsecond to year
Humanize dates and times with a growing list of contributed locales
Extensible for your own Arrow-derived types
Quick Start¶
Example Usage¶
>>> import arrow
>>> arrow.get('2013-05-11T21:23:58.970460+07:00')
<Arrow [2013-05-11T21:23:58.970460+07:00]>
>>> utc = arrow.utcnow()
>>> utc
<Arrow [2013-05-11T21:23:58.970460+00:00]>
>>> utc = utc.shift(hours=-1)
>>> utc
<Arrow [2013-05-11T20:23:58.970460+00:00]>
>>> local = utc.to('US/Pacific')
>>> local
<Arrow [2013-05-11T13:23:58.970460-07:00]>
>>> local.timestamp
1368303838
>>> local.format()
'2013-05-11 13:23:58 -07:00'
>>> local.format('YYYY-MM-DD HH:mm:ss ZZ')
'2013-05-11 13:23:58 -07:00'
>>> local.humanize()
'an hour ago'
>>> local.humanize(locale='ko_kr')
'1시간 전'
User’s Guide¶
Creation¶
Get ‘now’ easily:
>>> arrow.utcnow()
<Arrow [2013-05-07T04:20:39.369271+00:00]>
>>> arrow.now()
<Arrow [2013-05-06T21:20:40.841085-07:00]>
>>> arrow.now('US/Pacific')
<Arrow [2013-05-06T21:20:44.761511-07:00]>
Create from timestamps (int
or float
):
>>> arrow.get(1367900664)
<Arrow [2013-05-07T04:24:24+00:00]>
>>> arrow.get(1367900664.152325)
<Arrow [2013-05-07T04:24:24.152325+00:00]>
Use a naive or timezone-aware datetime, or flexibly specify a timezone:
>>> arrow.get(datetime.utcnow())
<Arrow [2013-05-07T04:24:24.152325+00:00]>
>>> arrow.get(datetime(2013, 5, 5), 'US/Pacific')
<Arrow [2013-05-05T00:00:00-07:00]>
>>> from dateutil import tz
>>> arrow.get(datetime(2013, 5, 5), tz.gettz('US/Pacific'))
<Arrow [2013-05-05T00:00:00-07:00]>
>>> arrow.get(datetime.now(tz.gettz('US/Pacific')))
<Arrow [2013-05-06T21:24:49.552236-07:00]>
Parse from a string:
>>> arrow.get('2013-05-05 12:30:45', 'YYYY-MM-DD HH:mm:ss')
<Arrow [2013-05-05T12:30:45+00:00]>
Search a date in a string:
>>> arrow.get('June was born in May 1980', 'MMMM YYYY')
<Arrow [1980-05-01T00:00:00+00:00]>
Some ISO 8601 compliant strings are recognized and parsed without a format string:
>>> arrow.get('2013-09-30T15:34:00.000-07:00')
<Arrow [2013-09-30T15:34:00-07:00]>
Arrow objects can be instantiated directly too, with the same arguments as a datetime:
>>> arrow.get(2013, 5, 5)
<Arrow [2013-05-05T00:00:00+00:00]>
>>> arrow.Arrow(2013, 5, 5)
<Arrow [2013-05-05T00:00:00+00:00]>
Properties¶
Get a datetime or timestamp representation:
>>> a = arrow.utcnow()
>>> a.datetime
datetime.datetime(2013, 5, 7, 4, 38, 15, 447644, tzinfo=tzutc())
>>> a.timestamp
1367901495
Get a naive datetime, and tzinfo:
>>> a.naive
datetime.datetime(2013, 5, 7, 4, 38, 15, 447644)
>>> a.tzinfo
tzutc()
Get any datetime value:
>>> a.year
2013
Call datetime functions that return properties:
>>> a.date()
datetime.date(2013, 5, 7)
>>> a.time()
datetime.time(4, 38, 15, 447644)
Replace & Shift¶
Get a new Arrow
object, with altered attributes, just as you would with a datetime:
>>> arw = arrow.utcnow()
>>> arw
<Arrow [2013-05-12T03:29:35.334214+00:00]>
>>> arw.replace(hour=4, minute=40)
<Arrow [2013-05-12T04:40:35.334214+00:00]>
Or, get one with attributes shifted forward or backward:
>>> arw.shift(weeks=+3)
<Arrow [2013-06-02T03:29:35.334214+00:00]>
Even replace the timezone without altering other attributes:
>>> arw.replace(tzinfo='US/Pacific')
<Arrow [2013-05-12T03:29:35.334214-07:00]>
Move between the earlier and later moments of an ambiguous time:
>>> paris_transition = arrow.Arrow(2019, 10, 27, 2, tzinfo="Europe/Paris", fold=0)
>>> paris_transition
<Arrow [2019-10-27T02:00:00+02:00]>
>>> paris_transition.ambiguous
True
>>> paris_transition.replace(fold=1)
<Arrow [2019-10-27T02:00:00+01:00]>
Format¶
>>> arrow.utcnow().format('YYYY-MM-DD HH:mm:ss ZZ')
'2013-05-07 05:23:16 -00:00'
Convert¶
Convert from UTC to other timezones by name or tzinfo:
>>> utc = arrow.utcnow()
>>> utc
<Arrow [2013-05-07T05:24:11.823627+00:00]>
>>> utc.to('US/Pacific')
<Arrow [2013-05-06T22:24:11.823627-07:00]>
>>> utc.to(tz.gettz('US/Pacific'))
<Arrow [2013-05-06T22:24:11.823627-07:00]>
Or using shorthand:
>>> utc.to('local')
<Arrow [2013-05-06T22:24:11.823627-07:00]>
>>> utc.to('local').to('utc')
<Arrow [2013-05-07T05:24:11.823627+00:00]>
Humanize¶
Humanize relative to now:
>>> past = arrow.utcnow().shift(hours=-1)
>>> past.humanize()
'an hour ago'
Or another Arrow, or datetime:
>>> present = arrow.utcnow()
>>> future = present.shift(hours=2)
>>> future.humanize(present)
'in 2 hours'
Indicate time as relative or include only the distance
>>> present = arrow.utcnow()
>>> future = present.shift(hours=2)
>>> future.humanize(present)
'in 2 hours'
>>> future.humanize(present, only_distance=True)
'2 hours'
Indicate a specific time granularity (or multiple):
>>> present = arrow.utcnow()
>>> future = present.shift(minutes=66)
>>> future.humanize(present, granularity="minute")
'in 66 minutes'
>>> future.humanize(present, granularity=["hour", "minute"])
'in an hour and 6 minutes'
>>> present.humanize(future, granularity=["hour", "minute"])
'an hour and 6 minutes ago'
>>> future.humanize(present, only_distance=True, granularity=["hour", "minute"])
'an hour and 6 minutes'
Support for a growing number of locales (see locales.py
for supported languages):
>>> future = arrow.utcnow().shift(hours=1)
>>> future.humanize(a, locale='ru')
'через 2 час(а,ов)'
Ranges & Spans¶
Get the time span of any unit:
>>> arrow.utcnow().span('hour')
(<Arrow [2013-05-07T05:00:00+00:00]>, <Arrow [2013-05-07T05:59:59.999999+00:00]>)
Or just get the floor and ceiling:
>>> arrow.utcnow().floor('hour')
<Arrow [2013-05-07T05:00:00+00:00]>
>>> arrow.utcnow().ceil('hour')
<Arrow [2013-05-07T05:59:59.999999+00:00]>
You can also get a range of time spans:
>>> start = datetime(2013, 5, 5, 12, 30)
>>> end = datetime(2013, 5, 5, 17, 15)
>>> for r in arrow.Arrow.span_range('hour', start, end):
... print r
...
(<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T12:59:59.999999+00:00]>)
(<Arrow [2013-05-05T13:00:00+00:00]>, <Arrow [2013-05-05T13:59:59.999999+00:00]>)
(<Arrow [2013-05-05T14:00:00+00:00]>, <Arrow [2013-05-05T14:59:59.999999+00:00]>)
(<Arrow [2013-05-05T15:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>)
(<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T16:59:59.999999+00:00]>)
Or just iterate over a range of time:
>>> start = datetime(2013, 5, 5, 12, 30)
>>> end = datetime(2013, 5, 5, 17, 15)
>>> for r in arrow.Arrow.range('hour', start, end):
... print repr(r)
...
<Arrow [2013-05-05T12:30:00+00:00]>
<Arrow [2013-05-05T13:30:00+00:00]>
<Arrow [2013-05-05T14:30:00+00:00]>
<Arrow [2013-05-05T15:30:00+00:00]>
<Arrow [2013-05-05T16:30:00+00:00]>
Factories¶
Use factories to harness Arrow’s module API for a custom Arrow-derived type. First, derive your type:
>>> class CustomArrow(arrow.Arrow):
...
... def days_till_xmas(self):
...
... xmas = arrow.Arrow(self.year, 12, 25)
...
... if self > xmas:
... xmas = xmas.shift(years=1)
...
... return (xmas - self).days
Then get and use a factory for it:
>>> factory = arrow.ArrowFactory(CustomArrow)
>>> custom = factory.utcnow()
>>> custom
>>> <CustomArrow [2013-05-27T23:35:35.533160+00:00]>
>>> custom.days_till_xmas()
>>> 211
Supported Tokens¶
Use the following tokens for parsing and formatting. Note that they are not the same as the tokens for strptime:
Token |
Output |
|
---|---|---|
Year |
YYYY |
2000, 2001, 2002 … 2012, 2013 |
YY |
00, 01, 02 … 12, 13 |
|
Month |
MMMM |
January, February, March … 1 |
MMM |
Jan, Feb, Mar … 1 |
|
MM |
01, 02, 03 … 11, 12 |
|
M |
1, 2, 3 … 11, 12 |
|
Day of Year |
DDDD |
001, 002, 003 … 364, 365 |
DDD |
1, 2, 3 … 364, 365 |
|
Day of Month |
DD |
01, 02, 03 … 30, 31 |
D |
1, 2, 3 … 30, 31 |
|
Do |
1st, 2nd, 3rd … 30th, 31st |
|
Day of Week |
dddd |
Monday, Tuesday, Wednesday … 2 |
ddd |
Mon, Tue, Wed … 2 |
|
d |
1, 2, 3 … 6, 7 |
|
ISO week date |
W |
2011-W05-4, 2019-W17 |
Hour |
HH |
00, 01, 02 … 23, 24 |
H |
0, 1, 2 … 23, 24 |
|
hh |
01, 02, 03 … 11, 12 |
|
h |
1, 2, 3 … 11, 12 |
|
AM / PM |
A |
AM, PM, am, pm 1 |
a |
am, pm 1 |
|
Minute |
mm |
00, 01, 02 … 58, 59 |
m |
0, 1, 2 … 58, 59 |
|
Second |
ss |
00, 01, 02 … 58, 59 |
s |
0, 1, 2 … 58, 59 |
|
Sub-second |
S… |
0, 02, 003, 000006, 123123123123… 3 |
Timezone |
ZZZ |
Asia/Baku, Europe/Warsaw, GMT … 4 |
ZZ |
-07:00, -06:00 … +06:00, +07:00, +08, Z |
|
Z |
-0700, -0600 … +0600, +0700, +08, Z |
|
Seconds Timestamp |
X |
1381685817, 1381685817.915482 … 5 |
ms or µs Timestamp |
x |
1569980330813, 1569980330813221 |
Footnotes
- 1(1,2,3,4)
localization support for parsing and formatting
- 2(1,2)
localization support only for formatting
- 3
the result is truncated to microseconds, with half-to-even rounding.
- 4
timezone names from tz database provided via dateutil package, note that abbreviations such as MST, PDT, BRST are unlikely to parse due to ambiguity. Use the full IANA zone name instead (Asia/Shanghai, Europe/London, America/Chicago etc).
- 5
this token cannot be used for parsing timestamps out of natural language strings due to compatibility reasons
Built-in Formats¶
There are several formatting standards that are provided as built-in tokens.
>>> arw = arrow.utcnow()
>>> arw.format(arrow.FORMAT_ATOM)
'2020-05-27 10:30:35+00:00'
>>> arw.format(arrow.FORMAT_COOKIE)
'Wednesday, 27-May-2020 10:30:35 UTC'
>>> arw.format(arrow.FORMAT_RSS)
'Wed, 27 May 2020 10:30:35 +0000'
>>> arw.format(arrow.FORMAT_RFC822)
'Wed, 27 May 20 10:30:35 +0000'
>>> arw.format(arrow.FORMAT_RFC850)
'Wednesday, 27-May-20 10:30:35 UTC'
>>> arw.format(arrow.FORMAT_RFC1036)
'Wed, 27 May 20 10:30:35 +0000'
>>> arw.format(arrow.FORMAT_RFC1123)
'Wed, 27 May 2020 10:30:35 +0000'
>>> arw.format(arrow.FORMAT_RFC2822)
'Wed, 27 May 2020 10:30:35 +0000'
>>> arw.format(arrow.FORMAT_RFC3339)
'2020-05-27 10:30:35+00:00'
>>> arw.format(arrow.FORMAT_W3C)
'2020-05-27 10:30:35+00:00'
Escaping Formats¶
Tokens, phrases, and regular expressions in a format string can be escaped when parsing and formatting by enclosing them within square brackets.
Tokens & Phrases¶
Any token or phrase can be escaped as follows:
>>> fmt = "YYYY-MM-DD h [h] m"
>>> arw = arrow.get("2018-03-09 8 h 40", fmt)
<Arrow [2018-03-09T08:40:00+00:00]>
>>> arw.format(fmt)
'2018-03-09 8 h 40'
>>> fmt = "YYYY-MM-DD h [hello] m"
>>> arw = arrow.get("2018-03-09 8 hello 40", fmt)
<Arrow [2018-03-09T08:40:00+00:00]>
>>> arw.format(fmt)
'2018-03-09 8 hello 40'
>>> fmt = "YYYY-MM-DD h [hello world] m"
>>> arw = arrow.get("2018-03-09 8 hello world 40", fmt)
<Arrow [2018-03-09T08:40:00+00:00]>
>>> arw.format(fmt)
'2018-03-09 8 hello world 40'
This can be useful for parsing dates in different locales such as French, in which it is common to format time strings as “8 h 40” rather than “8:40”.
Regular Expressions¶
You can also escape regular expressions by enclosing them within square brackets. In the following example, we are using the regular expression \s+
to match any number of whitespace characters that separate the tokens. This is useful if you do not know the number of spaces between tokens ahead of time (e.g. in log files).
>>> fmt = r"ddd[\s+]MMM[\s+]DD[\s+]HH:mm:ss[\s+]YYYY"
>>> arrow.get("Mon Sep 08 16:41:45 2014", fmt)
<Arrow [2014-09-08T16:41:45+00:00]>
>>> arrow.get("Mon \tSep 08 16:41:45 2014", fmt)
<Arrow [2014-09-08T16:41:45+00:00]>
>>> arrow.get("Mon Sep 08 16:41:45 2014", fmt)
<Arrow [2014-09-08T16:41:45+00:00]>
Punctuation¶
Date and time formats may be fenced on either side by one punctuation character from the following list: , . ; : ? ! " \` ' [ ] { } ( ) < >
>>> arrow.get("Cool date: 2019-10-31T09:12:45.123456+04:30.", "YYYY-MM-DDTHH:mm:ss.SZZ")
<Arrow [2019-10-31T09:12:45.123456+04:30]>
>>> arrow.get("Tomorrow (2019-10-31) is Halloween!", "YYYY-MM-DD")
<Arrow [2019-10-31T00:00:00+00:00]>
>>> arrow.get("Halloween is on 2019.10.31.", "YYYY.MM.DD")
<Arrow [2019-10-31T00:00:00+00:00]>
>>> arrow.get("It's Halloween tomorrow (2019-10-31)!", "YYYY-MM-DD")
# Raises exception because there are multiple punctuation marks following the date
Redundant Whitespace¶
Redundant whitespace characters (spaces, tabs, and newlines) can be normalized automatically by passing in the normalize_whitespace
flag to arrow.get
:
>>> arrow.get('\t \n 2013-05-05T12:30:45.123456 \t \n', normalize_whitespace=True)
<Arrow [2013-05-05T12:30:45.123456+00:00]>
>>> arrow.get('2013-05-05 T \n 12:30:45\t123456', 'YYYY-MM-DD T HH:mm:ss S', normalize_whitespace=True)
<Arrow [2013-05-05T12:30:45.123456+00:00]>
API Guide¶
arrow.arrow¶
Provides the Arrow
class, an enhanced datetime
replacement.
-
class
arrow.arrow.
Arrow
(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, **kwargs)¶ An
Arrow
object.Implements the
datetime
interface, behaving as an awaredatetime
while implementing additional functionality.- Parameters
year (
int
) – the calendar year.month (
int
) – the calendar month.day (
int
) – the calendar day.hour (
int
) – (optional) the hour. Defaults to 0.minute (
int
) – (optional) the minute, Defaults to 0.second (
int
) – (optional) the second, Defaults to 0.microsecond (
int
) – (optional) the microsecond. Defaults to 0.tzinfo (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults to UTC.fold – (optional) 0 or 1, used to disambiguate repeated times. Defaults to 0.
Recognized timezone expressions:
A
tzinfo
object.A
str
describing a timezone, similar to ‘US/Pacific’, or ‘Europe/Berlin’.A
str
in ISO 8601 style, as in ‘+07:00’.A
str
, one of the following: ‘local’, ‘utc’, ‘UTC’.
Usage:
>>> import arrow >>> arrow.Arrow(2013, 5, 5, 12, 30, 45) <Arrow [2013-05-05T12:30:45+00:00]>
-
property
ambiguous
¶ Returns a boolean indicating whether the
Arrow
object is ambiguous.- Return type
bool
-
astimezone
(tz)¶ Returns a
datetime
object, converted to the specified timezone.- Parameters
tz (
Optional
[tzinfo
]) – atzinfo
object.
Usage:
>>> pacific=arrow.now('US/Pacific') >>> nyc=arrow.now('America/New_York').tzinfo >>> pacific.astimezone(nyc) datetime.datetime(2019, 1, 20, 10, 24, 22, 328172, tzinfo=tzfile('/usr/share/zoneinfo/America/New_York'))
- Return type
datetime
-
ceil
(frame)¶ Returns a new
Arrow
object, representing the “ceiling” of the timespan of theArrow
object in a given timeframe. Equivalent to the second element in the 2-tuple returned byspan
.- Parameters
frame (
Literal
[‘year’, ‘years’, ‘month’, ‘months’, ‘day’, ‘days’, ‘hour’, ‘hours’, ‘minute’, ‘minutes’, ‘second’, ‘seconds’, ‘microsecond’, ‘microseconds’, ‘week’, ‘weeks’, ‘quarter’, ‘quarters’]) – the timeframe. Can be anydatetime
property (day, hour, minute…).
Usage:
>>> arrow.utcnow().ceil('hour') <Arrow [2013-05-09T03:59:59.999999+00:00]>
- Return type
-
clone
()¶ Returns a new
Arrow
object, cloned from the current one.Usage:
>>> arw = arrow.utcnow() >>> cloned = arw.clone()
- Return type
-
ctime
()¶ Returns a ctime formatted representation of the date and time.
Usage:
>>> arrow.utcnow().ctime() 'Sat Jan 19 18:26:50 2019'
- Return type
str
-
date
()¶ Returns a
date
object with the same year, month and day.Usage:
>>> arrow.utcnow().date() datetime.date(2019, 1, 23)
- Return type
date
-
property
datetime
¶ Returns a datetime representation of the
Arrow
object.Usage:
>>> arw=arrow.utcnow() >>> arw.datetime datetime.datetime(2019, 1, 24, 16, 35, 27, 276649, tzinfo=tzutc())
- Return type
datetime
-
dst
()¶ Returns the daylight savings time adjustment.
Usage:
>>> arrow.utcnow().dst() datetime.timedelta(0)
- Return type
Optional
[timedelta
]
-
property
float_timestamp
¶ Returns a floating-point representation of the
Arrow
object, in UTC time.Usage:
>>> arrow.utcnow().float_timestamp 1548260516.830896
- Return type
float
-
floor
(frame)¶ Returns a new
Arrow
object, representing the “floor” of the timespan of theArrow
object in a given timeframe. Equivalent to the first element in the 2-tuple returned byspan
.- Parameters
frame (
Literal
[‘year’, ‘years’, ‘month’, ‘months’, ‘day’, ‘days’, ‘hour’, ‘hours’, ‘minute’, ‘minutes’, ‘second’, ‘seconds’, ‘microsecond’, ‘microseconds’, ‘week’, ‘weeks’, ‘quarter’, ‘quarters’]) – the timeframe. Can be anydatetime
property (day, hour, minute…).
Usage:
>>> arrow.utcnow().floor('hour') <Arrow [2013-05-09T03:00:00+00:00]>
- Return type
-
for_json
()¶ Serializes for the
for_json
protocol of simplejson.Usage:
>>> arrow.utcnow().for_json() '2019-01-19T18:25:36.760079+00:00'
- Return type
str
-
format
(fmt='YYYY-MM-DD HH:mm:ssZZ', locale='en_us')¶ Returns a string representation of the
Arrow
object, formatted according to a format string.- Parameters
fmt (
str
) – the format string.locale (
str
) – the locale to format.
Usage:
>>> arrow.utcnow().format('YYYY-MM-DD HH:mm:ss ZZ') '2013-05-09 03:56:47 -00:00' >>> arrow.utcnow().format('X') '1368071882' >>> arrow.utcnow().format('MMMM DD, YYYY') 'May 09, 2013' >>> arrow.utcnow().format() '2013-05-09 03:56:47 -00:00'
- Return type
str
-
classmethod
fromdate
(date, tzinfo=None)¶ Constructs an
Arrow
object from adate
and optional replacement timezone. Time values are set to 0.- Parameters
date (
date
) – thedate
tzinfo (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults to UTC.
- Return type
-
classmethod
fromdatetime
(dt, tzinfo=None)¶ Constructs an
Arrow
object from adatetime
and optional replacement timezone.- Parameters
dt (
datetime
) – thedatetime
tzinfo (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults todt
’s timezone, or UTC if naive.
If you only want to replace the timezone of naive datetimes:
>>> dt datetime.datetime(2013, 5, 5, 0, 0, tzinfo=tzutc()) >>> arrow.Arrow.fromdatetime(dt, dt.tzinfo or 'US/Pacific') <Arrow [2013-05-05T00:00:00+00:00]>
- Return type
-
classmethod
fromordinal
(ordinal)¶ - Constructs an
Arrow
object corresponding to the Gregorian Ordinal.
- Parameters
ordinal (
int
) – anint
corresponding to a Gregorian Ordinal.
Usage:
>>> arrow.fromordinal(737741) <Arrow [2020-11-12T00:00:00+00:00]>
- Return type
- Constructs an
-
classmethod
fromtimestamp
(timestamp, tzinfo=None)¶ Constructs an
Arrow
object from a timestamp, converted to the given timezone.- Parameters
timestamp (
Union
[int
,float
,str
]) – anint
orfloat
timestamp, or astr
that converts to either.tzinfo (
Union
[tzinfo
,str
,None
]) – (optional) atzinfo
object. Defaults to local time.
- Return type
-
humanize
(other=None, locale='en_us', only_distance=False, granularity='auto')¶ Returns a localized, humanized representation of a relative difference in time.
- Parameters
other (
Union
[Arrow
,datetime
,None
]) – (optional) anArrow
ordatetime
object. Defaults to now in the currentArrow
object’s timezone.locale (
str
) – (optional) astr
specifying a locale. Defaults to ‘en_us’.only_distance (
bool
) – (optional) returns only time difference eg: “11 seconds” without “in” or “ago” part.granularity (
Union
[Literal
[‘auto’, ‘second’, ‘minute’, ‘hour’, ‘day’, ‘week’, ‘month’, ‘year’],List
[Literal
[‘auto’, ‘second’, ‘minute’, ‘hour’, ‘day’, ‘week’, ‘month’, ‘year’]]]) – (optional) defines the precision of the output. Set it to strings ‘second’, ‘minute’, ‘hour’, ‘day’, ‘week’, ‘month’ or ‘year’ or a list of any combination of these strings
Usage:
>>> earlier = arrow.utcnow().shift(hours=-2) >>> earlier.humanize() '2 hours ago' >>> later = earlier.shift(hours=4) >>> later.humanize(earlier) 'in 4 hours'
- Return type
str
-
property
imaginary
¶ Indicates whether the :class: Arrow <arrow.arrow.Arrow> object exists in the current timezone.
- Return type
bool
-
property
int_timestamp
¶ Returns a timestamp representation of the
Arrow
object, in UTC time.Usage:
>>> arrow.utcnow().int_timestamp 1548260567
- Return type
int
-
classmethod
interval
(frame, start, end, interval=1, tz=None, bounds='[)', exact=False)¶ Returns an iterator of tuples, each
Arrow
objects, representing a series of intervals between two inputs.- Parameters
frame (
Literal
[‘year’, ‘years’, ‘month’, ‘months’, ‘day’, ‘days’, ‘hour’, ‘hours’, ‘minute’, ‘minutes’, ‘second’, ‘seconds’, ‘microsecond’, ‘microseconds’, ‘week’, ‘weeks’, ‘quarter’, ‘quarters’]) – The timeframe. Can be anydatetime
property (day, hour, minute…).start (
datetime
) – A datetime expression, the start of the range.end (
datetime
) – (optional) A datetime expression, the end of the range.interval (
int
) – (optional) Time interval for the given time frame.tz (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults to UTC.bounds (
Literal
[‘[)’, ‘()’, ‘(]’, ‘[]’]) – (optional) astr
of either ‘()’, ‘(]’, ‘[)’, or ‘[]’ that specifies whether to include or exclude the start and end values in the intervals. ‘(‘ excludes the start, ‘[‘ includes the start, ‘)’ excludes the end, and ‘]’ includes the end. If the bounds are not specified, the default bound ‘[)’ is used.exact (
bool
) – (optional) whether to have the first timespan start exactly at the time specified bystart
and the final interval truncated so as not to extend beyondend
.
Supported frame values: year, quarter, month, week, day, hour, minute, second
Recognized datetime expressions:
An
Arrow
object.A
datetime
object.
Recognized timezone expressions:
A
tzinfo
object.A
str
describing a timezone, similar to ‘US/Pacific’, or ‘Europe/Berlin’.A
str
in ISO 8601 style, as in ‘+07:00’.A
str
, one of the following: ‘local’, ‘utc’, ‘UTC’.
Usage:
>>> start = datetime(2013, 5, 5, 12, 30) >>> end = datetime(2013, 5, 5, 17, 15) >>> for r in arrow.Arrow.interval('hour', start, end, 2): ... print r ... (<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T13:59:59.999999+00:00]>) (<Arrow [2013-05-05T14:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>) (<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T17:59:59.999999+00:0]>)
-
is_between
(start, end, bounds='()')¶ Returns a boolean denoting whether the specified date and time is between the start and end dates and times.
- Parameters
bounds (
Literal
[‘[)’, ‘()’, ‘(]’, ‘[]’]) – (optional) astr
of either ‘()’, ‘(]’, ‘[)’, or ‘[]’ that specifies whether to include or exclude the start and end values in the range. ‘(‘ excludes the start, ‘[‘ includes the start, ‘)’ excludes the end, and ‘]’ includes the end. If the bounds are not specified, the default bound ‘()’ is used.
Usage:
>>> start = arrow.get(datetime(2013, 5, 5, 12, 30, 10)) >>> end = arrow.get(datetime(2013, 5, 5, 12, 30, 36)) >>> arrow.get(datetime(2013, 5, 5, 12, 30, 27)).is_between(start, end) True >>> start = arrow.get(datetime(2013, 5, 5)) >>> end = arrow.get(datetime(2013, 5, 8)) >>> arrow.get(datetime(2013, 5, 8)).is_between(start, end, '[]') True >>> start = arrow.get(datetime(2013, 5, 5)) >>> end = arrow.get(datetime(2013, 5, 8)) >>> arrow.get(datetime(2013, 5, 8)).is_between(start, end, '[)') False
- Return type
bool
-
isocalendar
()¶ Returns a 3-tuple, (ISO year, ISO week number, ISO weekday).
Usage:
>>> arrow.utcnow().isocalendar() (2019, 3, 6)
- Return type
Tuple
[int
,int
,int
]
-
isoformat
(sep='T', timespec='auto')¶ Returns an ISO 8601 formatted representation of the date and time.
Usage:
>>> arrow.utcnow().isoformat() '2019-01-19T18:30:52.442118+00:00'
- Return type
str
-
isoweekday
()¶ Returns the ISO day of the week as an integer (1-7).
Usage:
>>> arrow.utcnow().isoweekday() 6
- Return type
int
-
property
naive
¶ Returns a naive datetime representation of the
Arrow
object.Usage:
>>> nairobi = arrow.now('Africa/Nairobi') >>> nairobi <Arrow [2019-01-23T19:27:12.297999+03:00]> >>> nairobi.naive datetime.datetime(2019, 1, 23, 19, 27, 12, 297999)
- Return type
datetime
-
classmethod
now
(tzinfo=None)¶ Constructs an
Arrow
object, representing “now” in the given timezone.- Parameters
tzinfo (
Optional
[tzinfo
]) – (optional) atzinfo
object. Defaults to local time.
Usage:
>>> arrow.now('Asia/Baku') <Arrow [2019-01-24T20:26:31.146412+04:00]>
- Return type
-
classmethod
range
(frame, start, end=None, tz=None, limit=None)¶ Returns an iterator of
Arrow
objects, representing points in time between two inputs.- Parameters
frame (
Literal
[‘year’, ‘years’, ‘month’, ‘months’, ‘day’, ‘days’, ‘hour’, ‘hours’, ‘minute’, ‘minutes’, ‘second’, ‘seconds’, ‘microsecond’, ‘microseconds’, ‘week’, ‘weeks’, ‘quarter’, ‘quarters’]) – The timeframe. Can be anydatetime
property (day, hour, minute…).start (
Union
[Arrow
,datetime
]) – A datetime expression, the start of the range.end (
Union
[Arrow
,datetime
,None
]) – (optional) A datetime expression, the end of the range.tz (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults tostart
’s timezone, or UTC ifstart
is naive.limit (
Optional
[int
]) – (optional) A maximum number of tuples to return.
NOTE: The
end
orlimit
must be provided. Call withend
alone to return the entire range. Call withlimit
alone to return a maximum # of results from the start. Call with both to cap a range at a maximum # of results.NOTE:
tz
internally replaces the timezones of bothstart
andend
before iterating. As such, either call with naive objects andtz
, or aware objects from the same timezone and notz
.Supported frame values: year, quarter, month, week, day, hour, minute, second.
Recognized datetime expressions:
An
Arrow
object.A
datetime
object.
Usage:
>>> start = datetime(2013, 5, 5, 12, 30) >>> end = datetime(2013, 5, 5, 17, 15) >>> for r in arrow.Arrow.range('hour', start, end): ... print(repr(r)) ... <Arrow [2013-05-05T12:30:00+00:00]> <Arrow [2013-05-05T13:30:00+00:00]> <Arrow [2013-05-05T14:30:00+00:00]> <Arrow [2013-05-05T15:30:00+00:00]> <Arrow [2013-05-05T16:30:00+00:00]>
NOTE: Unlike Python’s
range
,end
may be included in the returned iterator:>>> start = datetime(2013, 5, 5, 12, 30) >>> end = datetime(2013, 5, 5, 13, 30) >>> for r in arrow.Arrow.range('hour', start, end): ... print(repr(r)) ... <Arrow [2013-05-05T12:30:00+00:00]> <Arrow [2013-05-05T13:30:00+00:00]>
- Return type
Generator
[Arrow
,None
,None
]
-
replace
(**kwargs)¶ Returns a new
Arrow
object with attributes updated according to inputs.Use property names to set their value absolutely:
>>> import arrow >>> arw = arrow.utcnow() >>> arw <Arrow [2013-05-11T22:27:34.787885+00:00]> >>> arw.replace(year=2014, month=6) <Arrow [2014-06-11T22:27:34.787885+00:00]>
You can also replace the timezone without conversion, using a timezone expression:
>>> arw.replace(tzinfo=tz.tzlocal()) <Arrow [2013-05-11T22:27:34.787885-07:00]>
- Return type
-
shift
(**kwargs)¶ Returns a new
Arrow
object with attributes updated according to inputs.Use pluralized property names to relatively shift their current value:
>>> import arrow >>> arw = arrow.utcnow() >>> arw <Arrow [2013-05-11T22:27:34.787885+00:00]> >>> arw.shift(years=1, months=-1) <Arrow [2014-04-11T22:27:34.787885+00:00]>
Day-of-the-week relative shifting can use either Python’s weekday numbers (Monday = 0, Tuesday = 1 .. Sunday = 6) or using dateutil.relativedelta’s day instances (MO, TU .. SU). When using weekday numbers, the returned date will always be greater than or equal to the starting date.
Using the above code (which is a Saturday) and asking it to shift to Saturday:
>>> arw.shift(weekday=5) <Arrow [2013-05-11T22:27:34.787885+00:00]>
While asking for a Monday:
>>> arw.shift(weekday=0) <Arrow [2013-05-13T22:27:34.787885+00:00]>
- Return type
-
span
(frame, count=1, bounds='[)', exact=False)¶ Returns two new
Arrow
objects, representing the timespan of theArrow
object in a given timeframe.- Parameters
frame (
Literal
[‘year’, ‘years’, ‘month’, ‘months’, ‘day’, ‘days’, ‘hour’, ‘hours’, ‘minute’, ‘minutes’, ‘second’, ‘seconds’, ‘microsecond’, ‘microseconds’, ‘week’, ‘weeks’, ‘quarter’, ‘quarters’]) – the timeframe. Can be anydatetime
property (day, hour, minute…).count (
int
) – (optional) the number of frames to span.bounds (
Literal
[‘[)’, ‘()’, ‘(]’, ‘[]’]) – (optional) astr
of either ‘()’, ‘(]’, ‘[)’, or ‘[]’ that specifies whether to include or exclude the start and end values in the span. ‘(‘ excludes the start, ‘[‘ includes the start, ‘)’ excludes the end, and ‘]’ includes the end. If the bounds are not specified, the default bound ‘[)’ is used.exact (
bool
) – (optional) whether to have the start of the timespan begin exactly at the time specified bystart
and the end of the timespan truncated so as not to extend beyondend
.
Supported frame values: year, quarter, month, week, day, hour, minute, second.
Usage:
>>> arrow.utcnow() <Arrow [2013-05-09T03:32:36.186203+00:00]> >>> arrow.utcnow().span('hour') (<Arrow [2013-05-09T03:00:00+00:00]>, <Arrow [2013-05-09T03:59:59.999999+00:00]>) >>> arrow.utcnow().span('day') (<Arrow [2013-05-09T00:00:00+00:00]>, <Arrow [2013-05-09T23:59:59.999999+00:00]>) >>> arrow.utcnow().span('day', count=2) (<Arrow [2013-05-09T00:00:00+00:00]>, <Arrow [2013-05-10T23:59:59.999999+00:00]>) >>> arrow.utcnow().span('day', bounds='[]') (<Arrow [2013-05-09T00:00:00+00:00]>, <Arrow [2013-05-10T00:00:00+00:00]>)
-
classmethod
span_range
(frame, start, end, tz=None, limit=None, bounds='[)', exact=False)¶ Returns an iterator of tuples, each
Arrow
objects, representing a series of timespans between two inputs.- Parameters
frame (
Literal
[‘year’, ‘years’, ‘month’, ‘months’, ‘day’, ‘days’, ‘hour’, ‘hours’, ‘minute’, ‘minutes’, ‘second’, ‘seconds’, ‘microsecond’, ‘microseconds’, ‘week’, ‘weeks’, ‘quarter’, ‘quarters’]) – The timeframe. Can be anydatetime
property (day, hour, minute…).start (
datetime
) – A datetime expression, the start of the range.end (
datetime
) – (optional) A datetime expression, the end of the range.tz (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults tostart
’s timezone, or UTC ifstart
is naive.limit (
Optional
[int
]) – (optional) A maximum number of tuples to return.bounds (
Literal
[‘[)’, ‘()’, ‘(]’, ‘[]’]) – (optional) astr
of either ‘()’, ‘(]’, ‘[)’, or ‘[]’ that specifies whether to include or exclude the start and end values in each span in the range. ‘(‘ excludes the start, ‘[‘ includes the start, ‘)’ excludes the end, and ‘]’ includes the end. If the bounds are not specified, the default bound ‘[)’ is used.exact (
bool
) – (optional) whether to have the first timespan start exactly at the time specified bystart
and the final span truncated so as not to extend beyondend
.
NOTE: The
end
orlimit
must be provided. Call withend
alone to return the entire range. Call withlimit
alone to return a maximum # of results from the start. Call with both to cap a range at a maximum # of results.NOTE:
tz
internally replaces the timezones of bothstart
andend
before iterating. As such, either call with naive objects andtz
, or aware objects from the same timezone and notz
.Supported frame values: year, quarter, month, week, day, hour, minute, second.
Recognized datetime expressions:
An
Arrow
object.A
datetime
object.
NOTE: Unlike Python’s
range
,end
will always be included in the returned iterator of timespans.Usage:
>>> start = datetime(2013, 5, 5, 12, 30) >>> end = datetime(2013, 5, 5, 17, 15) >>> for r in arrow.Arrow.span_range('hour', start, end): ... print(r) ... (<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T12:59:59.999999+00:00]>) (<Arrow [2013-05-05T13:00:00+00:00]>, <Arrow [2013-05-05T13:59:59.999999+00:00]>) (<Arrow [2013-05-05T14:00:00+00:00]>, <Arrow [2013-05-05T14:59:59.999999+00:00]>) (<Arrow [2013-05-05T15:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>) (<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T16:59:59.999999+00:00]>) (<Arrow [2013-05-05T17:00:00+00:00]>, <Arrow [2013-05-05T17:59:59.999999+00:00]>)
-
strftime
(format)¶ Formats in the style of
datetime.strftime
.- Parameters
format (
str
) – the format string.
Usage:
>>> arrow.utcnow().strftime('%d-%m-%Y %H:%M:%S') '23-01-2019 12:28:17'
- Return type
str
-
classmethod
strptime
(date_str, fmt, tzinfo=None)¶ Constructs an
Arrow
object from a date string and format, in the style ofdatetime.strptime
. Optionally replaces the parsed timezone.- Parameters
date_str (
str
) – the date string.fmt (
str
) – the format string.tzinfo (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults to the parsed timezone iffmt
contains a timezone directive, otherwise UTC.
Usage:
>>> arrow.Arrow.strptime('20-01-2019 15:49:10', '%d-%m-%Y %H:%M:%S') <Arrow [2019-01-20T15:49:10+00:00]>
- Return type
-
time
()¶ Returns a
time
object with the same hour, minute, second, microsecond.Usage:
>>> arrow.utcnow().time() datetime.time(12, 15, 34, 68352)
- Return type
time
-
timestamp
()¶ Returns a timestamp representation of the
Arrow
object, in UTC time.Usage:
>>> arrow.utcnow().timestamp 1548260567
- Return type
float
-
timetuple
()¶ Returns a
time.struct_time
, in the current timezone.Usage:
>>> arrow.utcnow().timetuple() time.struct_time(tm_year=2019, tm_mon=1, tm_mday=20, tm_hour=15, tm_min=17, tm_sec=8, tm_wday=6, tm_yday=20, tm_isdst=0)
- Return type
struct_time
-
timetz
()¶ Returns a
time
object with the same hour, minute, second, microsecond and tzinfo.Usage:
>>> arrow.utcnow().timetz() datetime.time(12, 5, 18, 298893, tzinfo=tzutc())
- Return type
time
-
to
(tz)¶ Returns a new
Arrow
object, converted to the target timezone.- Parameters
tz (
Union
[tzinfo
,str
]) – A timezone expression.
Usage:
>>> utc = arrow.utcnow() >>> utc <Arrow [2013-05-09T03:49:12.311072+00:00]> >>> utc.to('US/Pacific') <Arrow [2013-05-08T20:49:12.311072-07:00]> >>> utc.to(tz.tzlocal()) <Arrow [2013-05-08T20:49:12.311072-07:00]> >>> utc.to('-07:00') <Arrow [2013-05-08T20:49:12.311072-07:00]> >>> utc.to('local') <Arrow [2013-05-08T20:49:12.311072-07:00]> >>> utc.to('local').to('utc') <Arrow [2013-05-09T03:49:12.311072+00:00]>
- Return type
-
toordinal
()¶ Returns the proleptic Gregorian ordinal of the date.
Usage:
>>> arrow.utcnow().toordinal() 737078
- Return type
int
-
property
tzinfo
¶ Gets the
tzinfo
of theArrow
object.Usage:
>>> arw=arrow.utcnow() >>> arw.tzinfo tzutc()
- Return type
tzinfo
-
classmethod
utcfromtimestamp
(timestamp)¶ Constructs an
Arrow
object from a timestamp, in UTC time.- Parameters
timestamp (
Union
[int
,float
,str
]) – anint
orfloat
timestamp, or astr
that converts to either.- Return type
-
classmethod
utcnow
()¶ Constructs an
Arrow
object, representing “now” in UTC time.Usage:
>>> arrow.utcnow() <Arrow [2019-01-24T16:31:40.651108+00:00]>
- Return type
-
utcoffset
()¶ Returns a
timedelta
object representing the whole number of minutes difference from UTC time.Usage:
>>> arrow.now('US/Pacific').utcoffset() datetime.timedelta(-1, 57600)
- Return type
Optional
[timedelta
]
-
utctimetuple
()¶ Returns a
time.struct_time
, in UTC time.Usage:
>>> arrow.utcnow().utctimetuple() time.struct_time(tm_year=2019, tm_mon=1, tm_mday=19, tm_hour=21, tm_min=41, tm_sec=7, tm_wday=5, tm_yday=19, tm_isdst=0)
- Return type
struct_time
-
weekday
()¶ Returns the day of the week as an integer (0-6).
Usage:
>>> arrow.utcnow().weekday() 5
- Return type
int
arrow.factory¶
Implements the ArrowFactory
class,
providing factory methods for common Arrow
construction scenarios.
-
class
arrow.factory.
ArrowFactory
(type=<class 'arrow.arrow.Arrow'>)¶ A factory for generating
Arrow
objects.- Parameters
type (
Type
[Arrow
]) – (optional) theArrow
-based class to construct from. Defaults toArrow
.
-
get
(*, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow¶ -
get
(__obj: Union[arrow.arrow.Arrow, datetime.datetime, datetime.date, time.struct_time, datetime.tzinfo, int, float, str, Tuple[int, int, int]], *, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow -
get
(__arg1: Union[datetime.datetime, datetime.date], __arg2: Union[datetime.tzinfo, str], *, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow -
get
(__arg1: str, __arg2: Union[str, List[str]], *, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow Returns an
Arrow
object based on flexible inputs.- Parameters
locale – (optional) a
str
specifying a locale for the parser. Defaults to ‘en_us’.tzinfo – (optional) a timezone expression or tzinfo object. Replaces the timezone unless using an input form that is explicitly UTC or specifies the timezone in a positional argument. Defaults to UTC.
normalize_whitespace – (optional) a
bool
specifying whether or not to normalize redundant whitespace (spaces, tabs, and newlines) in a datetime string before parsing. Defaults to false.
Usage:
>>> import arrow
No inputs to get current UTC time:
>>> arrow.get() <Arrow [2013-05-08T05:51:43.316458+00:00]>
None to also get current UTC time:
>>> arrow.get(None) <Arrow [2013-05-08T05:51:49.016458+00:00]>
One
Arrow
object, to get a copy.>>> arw = arrow.utcnow() >>> arrow.get(arw) <Arrow [2013-10-23T15:21:54.354846+00:00]>
One
float
orint
, convertible to a floating-point timestamp, to get that timestamp in UTC:>>> arrow.get(1367992474.293378) <Arrow [2013-05-08T05:54:34.293378+00:00]> >>> arrow.get(1367992474) <Arrow [2013-05-08T05:54:34+00:00]>
One ISO 8601-formatted
str
, to parse it:>>> arrow.get('2013-09-29T01:26:43.830580') <Arrow [2013-09-29T01:26:43.830580+00:00]>
One ISO 8601-formatted
str
, in basic format, to parse it:>>> arrow.get('20160413T133656.456289') <Arrow [2016-04-13T13:36:56.456289+00:00]>
One
tzinfo
, to get the current time converted to that timezone:>>> arrow.get(tz.tzlocal()) <Arrow [2013-05-07T22:57:28.484717-07:00]>
One naive
datetime
, to get that datetime in UTC:>>> arrow.get(datetime(2013, 5, 5)) <Arrow [2013-05-05T00:00:00+00:00]>
One aware
datetime
, to get that datetime:>>> arrow.get(datetime(2013, 5, 5, tzinfo=tz.tzlocal())) <Arrow [2013-05-05T00:00:00-07:00]>
One naive
date
, to get that date in UTC:>>> arrow.get(date(2013, 5, 5)) <Arrow [2013-05-05T00:00:00+00:00]>
One time.struct time:
>>> arrow.get(gmtime(0)) <Arrow [1970-01-01T00:00:00+00:00]>
One iso calendar
tuple
, to get that week date in UTC:>>> arrow.get((2013, 18, 7)) <Arrow [2013-05-05T00:00:00+00:00]>
Two arguments, a naive or aware
datetime
, and a replacement timezone expression:>>> arrow.get(datetime(2013, 5, 5), 'US/Pacific') <Arrow [2013-05-05T00:00:00-07:00]>
Two arguments, a naive
date
, and a replacement timezone expression:>>> arrow.get(date(2013, 5, 5), 'US/Pacific') <Arrow [2013-05-05T00:00:00-07:00]>
Two arguments, both
str
, to parse the first according to the format of the second:>>> arrow.get('2013-05-05 12:30:45 America/Chicago', 'YYYY-MM-DD HH:mm:ss ZZZ') <Arrow [2013-05-05T12:30:45-05:00]>
Two arguments, first a
str
to parse and second alist
of formats to try:>>> arrow.get('2013-05-05 12:30:45', ['MM/DD/YYYY', 'YYYY-MM-DD HH:mm:ss']) <Arrow [2013-05-05T12:30:45+00:00]>
Three or more arguments, as for the constructor of a
datetime
:>>> arrow.get(2013, 5, 5, 12, 30, 45) <Arrow [2013-05-05T12:30:45+00:00]>
- Return type
-
now
(tz=None)¶ Returns an
Arrow
object, representing “now” in the given timezone.- Parameters
tz (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults to local time.
Usage:
>>> import arrow >>> arrow.now() <Arrow [2013-05-07T22:19:11.363410-07:00]> >>> arrow.now('US/Pacific') <Arrow [2013-05-07T22:19:15.251821-07:00]> >>> arrow.now('+02:00') <Arrow [2013-05-08T07:19:25.618646+02:00]> >>> arrow.now('local') <Arrow [2013-05-07T22:19:39.130059-07:00]>
- Return type
arrow.api¶
Provides the default implementation of ArrowFactory
methods for use as a module API.
-
arrow.api.
factory
(type)¶ Returns an
ArrowFactory
for the specifiedArrow
or derived type.- Parameters
- Return type
-
arrow.api.
get
(*, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow¶ -
arrow.api.
get
(__obj: Union[arrow.arrow.Arrow, datetime.datetime, datetime.date, time.struct_time, datetime.tzinfo, int, float, str, Tuple[int, int, int]], *, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow -
arrow.api.
get
(__arg1: Union[datetime.datetime, datetime.date], __arg2: Union[datetime.tzinfo, str], *, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow -
arrow.api.
get
(__arg1: str, __arg2: Union[str, List[str]], *, locale: str = "'en_us'", tzinfo: Optional[Union[datetime.tzinfo, str]] = 'None', normalize_whitespace: bool = 'False') → arrow.arrow.Arrow Returns an
Arrow
object based on flexible inputs.- Parameters
locale – (optional) a
str
specifying a locale for the parser. Defaults to ‘en_us’.tzinfo – (optional) a timezone expression or tzinfo object. Replaces the timezone unless using an input form that is explicitly UTC or specifies the timezone in a positional argument. Defaults to UTC.
normalize_whitespace – (optional) a
bool
specifying whether or not to normalize redundant whitespace (spaces, tabs, and newlines) in a datetime string before parsing. Defaults to false.
Usage:
>>> import arrow
No inputs to get current UTC time:
>>> arrow.get() <Arrow [2013-05-08T05:51:43.316458+00:00]>
None to also get current UTC time:
>>> arrow.get(None) <Arrow [2013-05-08T05:51:49.016458+00:00]>
One
Arrow
object, to get a copy.>>> arw = arrow.utcnow() >>> arrow.get(arw) <Arrow [2013-10-23T15:21:54.354846+00:00]>
One
float
orint
, convertible to a floating-point timestamp, to get that timestamp in UTC:>>> arrow.get(1367992474.293378) <Arrow [2013-05-08T05:54:34.293378+00:00]> >>> arrow.get(1367992474) <Arrow [2013-05-08T05:54:34+00:00]>
One ISO 8601-formatted
str
, to parse it:>>> arrow.get('2013-09-29T01:26:43.830580') <Arrow [2013-09-29T01:26:43.830580+00:00]>
One ISO 8601-formatted
str
, in basic format, to parse it:>>> arrow.get('20160413T133656.456289') <Arrow [2016-04-13T13:36:56.456289+00:00]>
One
tzinfo
, to get the current time converted to that timezone:>>> arrow.get(tz.tzlocal()) <Arrow [2013-05-07T22:57:28.484717-07:00]>
One naive
datetime
, to get that datetime in UTC:>>> arrow.get(datetime(2013, 5, 5)) <Arrow [2013-05-05T00:00:00+00:00]>
One aware
datetime
, to get that datetime:>>> arrow.get(datetime(2013, 5, 5, tzinfo=tz.tzlocal())) <Arrow [2013-05-05T00:00:00-07:00]>
One naive
date
, to get that date in UTC:>>> arrow.get(date(2013, 5, 5)) <Arrow [2013-05-05T00:00:00+00:00]>
One time.struct time:
>>> arrow.get(gmtime(0)) <Arrow [1970-01-01T00:00:00+00:00]>
One iso calendar
tuple
, to get that week date in UTC:>>> arrow.get((2013, 18, 7)) <Arrow [2013-05-05T00:00:00+00:00]>
Two arguments, a naive or aware
datetime
, and a replacement timezone expression:>>> arrow.get(datetime(2013, 5, 5), 'US/Pacific') <Arrow [2013-05-05T00:00:00-07:00]>
Two arguments, a naive
date
, and a replacement timezone expression:>>> arrow.get(date(2013, 5, 5), 'US/Pacific') <Arrow [2013-05-05T00:00:00-07:00]>
Two arguments, both
str
, to parse the first according to the format of the second:>>> arrow.get('2013-05-05 12:30:45 America/Chicago', 'YYYY-MM-DD HH:mm:ss ZZZ') <Arrow [2013-05-05T12:30:45-05:00]>
Two arguments, first a
str
to parse and second alist
of formats to try:>>> arrow.get('2013-05-05 12:30:45', ['MM/DD/YYYY', 'YYYY-MM-DD HH:mm:ss']) <Arrow [2013-05-05T12:30:45+00:00]>
Three or more arguments, as for the constructor of a
datetime
:>>> arrow.get(2013, 5, 5, 12, 30, 45) <Arrow [2013-05-05T12:30:45+00:00]>
- Return type
-
arrow.api.
now
(tz=None)¶ Returns an
Arrow
object, representing “now” in the given timezone.- Parameters
tz (
Union
[tzinfo
,str
,None
]) – (optional) A timezone expression. Defaults to local time.
Usage:
>>> import arrow >>> arrow.now() <Arrow [2013-05-07T22:19:11.363410-07:00]> >>> arrow.now('US/Pacific') <Arrow [2013-05-07T22:19:15.251821-07:00]> >>> arrow.now('+02:00') <Arrow [2013-05-08T07:19:25.618646+02:00]> >>> arrow.now('local') <Arrow [2013-05-07T22:19:39.130059-07:00]>
- Return type
arrow.locale¶
-
class
arrow.locales.
AfrikaansLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za', 'So']¶
-
day_names
: ClassVar[List[str]] = ['', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag', 'Sondag']¶
-
future
: ClassVar[str] = 'in {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des']¶
-
month_names
: ClassVar[List[str]] = ['', 'Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember']¶
-
names
: ClassVar[List[str]] = ['af', 'af_nl']¶
-
past
: ClassVar[str] = '{0} gelede'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'een dag', 'days': '{0} dae', 'hour': 'uur', 'hours': '{0} ure', 'minute': 'minuut', 'minutes': '{0} minute', 'month': 'een maand', 'months': '{0} maande', 'now': 'nou', 'second': 'n sekonde', 'seconds': '{0} sekondes', 'year': 'een jaar', 'years': '{0} jaar'}¶
-
-
class
arrow.locales.
AlgeriaTunisiaArabicLocale
¶ -
month_abbreviations
: ClassVar[List[str]] = ['', 'جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر']¶
-
month_names
: ClassVar[List[str]] = ['', 'جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر']¶
-
names
: ClassVar[List[str]] = ['ar_tn', 'ar_dz']¶
-
-
class
arrow.locales.
ArabicLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت', 'أحد']¶
-
day_names
: ClassVar[List[str]] = ['', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', 'الأحد']¶
-
future
: ClassVar[str] = 'خلال {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر']¶
-
month_names
: ClassVar[List[str]] = ['', 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر']¶
-
names
: ClassVar[List[str]] = ['ar', 'ar_ae', 'ar_bh', 'ar_dj', 'ar_eg', 'ar_eh', 'ar_er', 'ar_km', 'ar_kw', 'ar_ly', 'ar_om', 'ar_qa', 'ar_sa', 'ar_sd', 'ar_so', 'ar_ss', 'ar_td', 'ar_ye']¶
-
past
: ClassVar[str] = 'منذ {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Mapping[str, str]]]] = {'day': 'يوم', 'days': {'double': 'يومين', 'higher': '{0} يوم', 'ten': '{0} أيام'}, 'hour': 'ساعة', 'hours': {'double': 'ساعتين', 'higher': '{0} ساعة', 'ten': '{0} ساعات'}, 'minute': 'دقيقة', 'minutes': {'double': 'دقيقتين', 'higher': '{0} دقيقة', 'ten': '{0} دقائق'}, 'month': 'شهر', 'months': {'double': 'شهرين', 'higher': '{0} شهر', 'ten': '{0} أشهر'}, 'now': 'الآن', 'second': 'ثانية', 'seconds': {'double': 'ثانيتين', 'higher': '{0} ثانية', 'ten': '{0} ثوان'}, 'year': 'سنة', 'years': {'double': 'سنتين', 'higher': '{0} سنة', 'ten': '{0} سنوات'}}¶
-
-
class
arrow.locales.
AustrianLocale
¶ -
month_names
: ClassVar[List[str]] = ['', 'Jänner', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']¶
-
names
: ClassVar[List[str]] = ['de_at']¶
-
-
class
arrow.locales.
AzerbaijaniLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Ber', 'Çax', 'Çər', 'Cax', 'Cüm', 'Şnb', 'Bzr']¶
-
day_names
: ClassVar[List[str]] = ['', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə', 'Bazar']¶
-
future
: ClassVar[str] = '{0} sonra'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek']¶
-
month_names
: ClassVar[List[str]] = ['', 'Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr']¶
-
names
: ClassVar[List[str]] = ['az', 'az_az']¶
-
past
: ClassVar[str] = '{0} əvvəl'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'bir gün', 'days': '{0} gün', 'hour': 'bir saat', 'hours': '{0} saat', 'minute': 'bir dəqiqə', 'minutes': '{0} dəqiqə', 'month': 'bir ay', 'months': '{0} ay', 'now': 'indi', 'second': 'saniyə', 'seconds': '{0} saniyə', 'year': 'il', 'years': '{0} il'}¶
-
-
class
arrow.locales.
BasqueLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'al', 'ar', 'az', 'og', 'ol', 'lr', 'ig']¶
-
day_names
: ClassVar[List[str]] = ['', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata', 'igandea']¶
-
future
: ClassVar[str] = '{0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'urt', 'ots', 'mar', 'api', 'mai', 'eka', 'uzt', 'abu', 'ira', 'urr', 'aza', 'abe']¶
-
month_names
: ClassVar[List[str]] = ['', 'urtarrilak', 'otsailak', 'martxoak', 'apirilak', 'maiatzak', 'ekainak', 'uztailak', 'abuztuak', 'irailak', 'urriak', 'azaroak', 'abenduak']¶
-
names
: ClassVar[List[str]] = ['eu', 'eu_eu']¶
-
past
: ClassVar[str] = 'duela {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'egun bat', 'days': '{0} egun', 'hour': 'ordu bat', 'hours': '{0} ordu', 'minute': 'minutu bat', 'minutes': '{0} minutu', 'month': 'hilabete bat', 'months': '{0} hilabet', 'now': 'Orain', 'second': 'segundo bat', 'seconds': '{0} segundu', 'year': 'urte bat', 'years': '{0} urte'}¶
-
-
class
arrow.locales.
BelarusianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб', 'нд']¶
-
day_names
: ClassVar[List[str]] = ['', 'панядзелак', 'аўторак', 'серада', 'чацвер', 'пятніца', 'субота', 'нядзеля']¶
-
future
: ClassVar[str] = 'праз {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'студ', 'лют', 'сак', 'крас', 'трав', 'чэрв', 'ліп', 'жнів', 'вер', 'каст', 'ліст', 'снеж']¶
-
month_names
: ClassVar[List[str]] = ['', 'студзеня', 'лютага', 'сакавіка', 'красавіка', 'траўня', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня']¶
-
names
: ClassVar[List[str]] = ['be', 'be_by']¶
-
past
: ClassVar[str] = '{0} таму'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, List[str]]]] = {'day': 'дзень', 'days': ['{0} дзень', '{0} дні', '{0} дзён'], 'hour': 'гадзіну', 'hours': ['{0} гадзіну', '{0} гадзіны', '{0} гадзін'], 'minute': 'хвіліну', 'minutes': ['{0} хвіліну', '{0} хвіліны', '{0} хвілін'], 'month': 'месяц', 'months': ['{0} месяц', '{0} месяцы', '{0} месяцаў'], 'now': 'зараз', 'second': 'секунду', 'seconds': '{0} некалькі секунд', 'year': 'год', 'years': ['{0} год', '{0} гады', '{0} гадоў']}¶
-
-
class
arrow.locales.
BengaliLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি', 'রবি']¶
-
day_names
: ClassVar[List[str]] = ['', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার', 'রবিবার']¶
-
future
: ClassVar[str] = '{0} পরে'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'সকাল', 'PM': 'বিকাল', 'am': 'সকাল', 'pm': 'বিকাল'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'জানু', 'ফেব', 'মার্চ', 'এপ্রি', 'মে', 'জুন', 'জুল', 'অগা', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে']¶
-
month_names
: ClassVar[List[str]] = ['', 'জানুয়ারি', 'ফেব্রুয়ারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর']¶
-
names
: ClassVar[List[str]] = ['bn', 'bn_bd', 'bn_in']¶
-
past
: ClassVar[str] = '{0} আগে'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'এক দিন', 'days': '{0} দিন', 'hour': 'এক ঘণ্টা', 'hours': '{0} ঘণ্টা', 'minute': 'এক মিনিট', 'minutes': '{0} মিনিট', 'month': 'এক মাস', 'months': '{0} মাস ', 'now': 'এখন', 'second': 'একটি দ্বিতীয়', 'seconds': '{0} সেকেন্ড', 'year': 'এক বছর', 'years': '{0} বছর'}¶
-
-
class
arrow.locales.
BrazilianPortugueseLocale
¶ -
names
: ClassVar[List[str]] = ['pt_br']¶
-
past
: ClassVar[str] = 'faz {0}'¶
-
-
class
arrow.locales.
BulgarianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'пон', 'вт', 'ср', 'четв', 'пет', 'съб', 'нед']¶
-
day_names
: ClassVar[List[str]] = ['', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота', 'неделя']¶
-
future
: ClassVar[str] = 'напред {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'ян', 'февр', 'март', 'апр', 'май', 'юни', 'юли', 'авг', 'септ', 'окт', 'ноем', 'дек']¶
-
month_names
: ClassVar[List[str]] = ['', 'януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември']¶
-
names
: ClassVar[List[str]] = ['bg', 'bg_BG']¶
-
past
: ClassVar[str] = '{0} назад'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, List[str]]]] = {'day': 'ден', 'days': ['{0} ден', '{0} дни', '{0} дни'], 'hour': 'час', 'hours': ['{0} час', '{0} часа', '{0} часа'], 'minute': 'минута', 'minutes': ['{0} минута', '{0} минути', '{0} минути'], 'month': 'месец', 'months': ['{0} месец', '{0} месеца', '{0} месеца'], 'now': 'сега', 'second': 'секунда', 'seconds': '{0} няколко секунди', 'year': 'година', 'years': ['{0} година', '{0} години', '{0} години']}¶
-
-
class
arrow.locales.
CatalanLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'i'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.', 'dg.']¶
-
day_names
: ClassVar[List[str]] = ['', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte', 'diumenge']¶
-
future
: ClassVar[str] = 'En {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'gen.', 'febr.', 'març', 'abr.', 'maig', 'juny', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', 'des.']¶
-
month_names
: ClassVar[List[str]] = ['', 'gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octubre', 'novembre', 'desembre']¶
-
names
: ClassVar[List[str]] = ['ca', 'ca_es', 'ca_ad', 'ca_fr', 'ca_it']¶
-
past
: ClassVar[str] = 'Fa {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'un dia', 'days': '{0} dies', 'hour': 'una hora', 'hours': '{0} hores', 'minute': '1 minut', 'minutes': '{0} minuts', 'month': 'un mes', 'months': '{0} mesos', 'now': 'Ara mateix', 'second': 'un segon', 'seconds': '{0} segons', 'year': 'un any', 'years': '{0} anys'}¶
-
-
class
arrow.locales.
ChineseCNLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', '一', '二', '三', '四', '五', '六', '日']¶
-
day_names
: ClassVar[List[str]] = ['', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']¶
-
future
: ClassVar[str] = '{0}后'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', ' 1', ' 2', ' 3', ' 4', ' 5', ' 6', ' 7', ' 8', ' 9', '10', '11', '12']¶
-
month_names
: ClassVar[List[str]] = ['', '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']¶
-
names
: ClassVar[List[str]] = ['zh', 'zh_cn']¶
-
past
: ClassVar[str] = '{0}前'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '1天', 'days': '{0}天', 'hour': '1小时', 'hours': '{0}小时', 'minute': '1分钟', 'minutes': '{0}分钟', 'month': '1个月', 'months': '{0}个月', 'now': '刚才', 'second': '一秒', 'seconds': '{0}秒', 'week': '一周', 'weeks': '{0}周', 'year': '1年', 'years': '{0}年'}¶
-
-
class
arrow.locales.
ChineseTWLocale
¶ -
and_word
: ClassVar[Optional[str]] = '和'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', '一', '二', '三', '四', '五', '六', '日']¶
-
day_names
: ClassVar[List[str]] = ['', '週一', '週二', '週三', '週四', '週五', '週六', '週日']¶
-
future
: ClassVar[str] = '{0}後'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', ' 1', ' 2', ' 3', ' 4', ' 5', ' 6', ' 7', ' 8', ' 9', '10', '11', '12']¶
-
month_names
: ClassVar[List[str]] = ['', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']¶
-
names
: ClassVar[List[str]] = ['zh_tw']¶
-
past
: ClassVar[str] = '{0}前'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '1天', 'days': '{0}天', 'hour': '1小時', 'hours': '{0}小時', 'minute': '1分鐘', 'minutes': '{0}分鐘', 'month': '1個月', 'months': '{0}個月', 'now': '剛才', 'second': '1秒', 'seconds': '{0}秒', 'week': '1週', 'weeks': '{0}週', 'year': '1年', 'years': '{0}年'}¶
-
-
class
arrow.locales.
CzechLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'po', 'út', 'st', 'čt', 'pá', 'so', 'ne']¶
-
day_names
: ClassVar[List[str]] = ['', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota', 'neděle']¶
-
future
: ClassVar[str] = 'Za {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro']¶
-
month_names
: ClassVar[List[str]] = ['', 'leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec']¶
-
names
: ClassVar[List[str]] = ['cs', 'cs_cz']¶
-
past
: ClassVar[str] = 'Před {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[Mapping[str, Union[List[str], str]], str]]] = {'day': {'future': 'den', 'past': 'dnem', 'zero': '{0} dnů'}, 'days': {'future': ['{0} dny', '{0} dnů'], 'past': '{0} dny'}, 'hour': {'future': 'hodinu', 'past': 'hodinou', 'zero': '{0} hodin'}, 'hours': {'future': ['{0} hodiny', '{0} hodin'], 'past': '{0} hodinami'}, 'minute': {'future': 'minutu', 'past': 'minutou', 'zero': '{0} minut'}, 'minutes': {'future': ['{0} minuty', '{0} minut'], 'past': '{0} minutami'}, 'month': {'future': 'měsíc', 'past': 'měsícem', 'zero': '{0} měsíců'}, 'months': {'future': ['{0} měsíce', '{0} měsíců'], 'past': '{0} měsíci'}, 'now': 'Teď', 'second': {'future': 'vteřina', 'past': 'vteřina', 'zero': 'vteřina'}, 'seconds': {'future': ['{0} sekundy', '{0} sekund'], 'past': '{0} sekundami'}, 'week': {'future': 'týden', 'past': 'týdnem', 'zero': '{0} týdnů'}, 'weeks': {'future': ['{0} týdny', '{0} týdnů'], 'past': '{0} týdny'}, 'year': {'future': 'rok', 'past': 'rokem', 'zero': '{0} let'}, 'years': {'future': ['{0} roky', '{0} let'], 'past': '{0} lety'}}¶
-
-
class
arrow.locales.
DanishLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'og'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'man', 'tir', 'ons', 'tor', 'fre', 'lør', 'søn']¶
-
day_names
: ClassVar[List[str]] = ['', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', 'søndag']¶
-
future
: ClassVar[str] = 'efter {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december']¶
-
names
: ClassVar[List[str]] = ['da', 'da_dk']¶
-
past
: ClassVar[str] = 'for {0} siden'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'en dag', 'days': '{0} dage', 'hour': 'en time', 'hours': '{0} timer', 'minute': 'et minut', 'minutes': '{0} minutter', 'month': 'en måned', 'months': '{0} måneder', 'now': 'lige nu', 'second': 'et sekund', 'seconds': '{0} et par sekunder', 'year': 'et år', 'years': '{0} år'}¶
-
-
class
arrow.locales.
DutchLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'ma', 'di', 'wo', 'do', 'vr', 'za', 'zo']¶
-
day_names
: ClassVar[List[str]] = ['', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag']¶
-
future
: ClassVar[str] = 'over {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december']¶
-
names
: ClassVar[List[str]] = ['nl', 'nl_nl']¶
-
past
: ClassVar[str] = '{0} geleden'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'een dag', 'days': '{0} dagen', 'hour': 'een uur', 'hours': '{0} uur', 'minute': 'een minuut', 'minutes': '{0} minuten', 'month': 'een maand', 'months': '{0} maanden', 'now': 'nu', 'second': 'een seconde', 'seconds': '{0} seconden', 'week': 'een week', 'weeks': '{0} weken', 'year': 'een jaar', 'years': '{0} jaar'}¶
-
-
class
arrow.locales.
EnglishLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'and'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']¶
-
day_names
: ClassVar[List[str]] = ['', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']¶
-
describe
(timeframe, delta=0, only_distance=False)¶ Describes a delta within a timeframe in plain language.
- Parameters
timeframe (
Literal
[‘now’, ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘day’, ‘days’, ‘week’, ‘weeks’, ‘month’, ‘months’, ‘year’, ‘years’, ‘2-hours’, ‘2-days’, ‘2-weeks’, ‘2-months’, ‘2-years’]) – a string representing a timeframe.delta (
Union
[int
,float
]) – a quantity representing a delta in a timeframe.only_distance (
bool
) – return only distance eg: “11 seconds” without “in” or “ago” keywords
- Return type
str
-
future
: ClassVar[str] = 'in {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'AM', 'PM': 'PM', 'am': 'am', 'pm': 'pm'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']¶
-
names
: ClassVar[List[str]] = ['en', 'en_us', 'en_gb', 'en_au', 'en_be', 'en_jp', 'en_za', 'en_ca', 'en_ph']¶
-
ordinal_day_re
: ClassVar[str] = '((?P<value>[2-3]?1(?=st)|[2-3]?2(?=nd)|[2-3]?3(?=rd)|[1-3]?[04-9](?=th)|1[1-3](?=th))(st|nd|rd|th))'¶
-
past
: ClassVar[str] = '{0} ago'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'a day', 'days': '{0} days', 'hour': 'an hour', 'hours': '{0} hours', 'minute': 'a minute', 'minutes': '{0} minutes', 'month': 'a month', 'months': '{0} months', 'now': 'just now', 'second': 'a second', 'seconds': '{0} seconds', 'week': 'a week', 'weeks': '{0} weeks', 'year': 'a year', 'years': '{0} years'}¶
-
-
class
arrow.locales.
EsperantoLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'lun', 'mar', 'mer', 'ĵaŭ', 'ven', 'sab', 'dim']¶
-
day_names
: ClassVar[List[str]] = ['', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato', 'dimanĉo']¶
-
future
: ClassVar[str] = 'post {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'ATM', 'PM': 'PTM', 'am': 'atm', 'pm': 'ptm'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aŭg', 'sep', 'okt', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'januaro', 'februaro', 'marto', 'aprilo', 'majo', 'junio', 'julio', 'aŭgusto', 'septembro', 'oktobro', 'novembro', 'decembro']¶
-
names
: ClassVar[List[str]] = ['eo', 'eo_xx']¶
-
ordinal_day_re
: ClassVar[str] = '((?P<value>[1-3]?[0-9](?=a))a)'¶
-
past
: ClassVar[str] = 'antaŭ {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'unu tago', 'days': '{0} tagoj', 'hour': 'un horo', 'hours': '{0} horoj', 'minute': 'unu minuto', 'minutes': '{0} minutoj', 'month': 'unu monato', 'months': '{0} monatoj', 'now': 'nun', 'second': 'sekundo', 'seconds': '{0} kelkaj sekundoj', 'year': 'unu jaro', 'years': '{0} jaroj'}¶
-
-
class
arrow.locales.
EstonianLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'ja'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Esm', 'Teis', 'Kolm', 'Nelj', 'Re', 'Lau', 'Püh']¶
-
day_names
: ClassVar[List[str]] = ['', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev', 'Pühapäev']¶
-
future
: ClassVar[str] = '{0} pärast'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Veb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dets']¶
-
month_names
: ClassVar[List[str]] = ['', 'Jaanuar', 'Veebruar', 'Märts', 'Aprill', 'Mai', 'Juuni', 'Juuli', 'August', 'September', 'Oktoober', 'November', 'Detsember']¶
-
names
: ClassVar[List[str]] = ['ee', 'et']¶
-
past
: ClassVar[str] = '{0} tagasi'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Mapping[str, str]]] = {'day': {'future': 'ühe päeva', 'past': 'üks päev'}, 'days': {'future': '{0} päeva', 'past': '{0} päeva'}, 'hour': {'future': 'tunni aja', 'past': 'tund aega'}, 'hours': {'future': '{0} tunni', 'past': '{0} tundi'}, 'minute': {'future': 'ühe minuti', 'past': 'üks minut'}, 'minutes': {'future': '{0} minuti', 'past': '{0} minutit'}, 'month': {'future': 'ühe kuu', 'past': 'üks kuu'}, 'months': {'future': '{0} kuu', 'past': '{0} kuud'}, 'now': {'future': 'just nüüd', 'past': 'just nüüd'}, 'second': {'future': 'ühe sekundi', 'past': 'üks sekund'}, 'seconds': {'future': '{0} sekundi', 'past': '{0} sekundit'}, 'year': {'future': 'ühe aasta', 'past': 'üks aasta'}, 'years': {'future': '{0} aasta', 'past': '{0} aastat'}}¶
-
-
class
arrow.locales.
FarsiLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']¶
-
day_names
: ClassVar[List[str]] = ['', 'دو شنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه', 'یکشنبه']¶
-
future
: ClassVar[str] = 'در {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'قبل از ظهر', 'PM': 'بعد از ظهر', 'am': 'قبل از ظهر', 'pm': 'بعد از ظهر'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']¶
-
names
: ClassVar[List[str]] = ['fa', 'fa_ir']¶
-
past
: ClassVar[str] = '{0} قبل'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'یک روز', 'days': '{0} روز', 'hour': 'یک ساعت', 'hours': '{0} ساعت', 'minute': 'یک دقیقه', 'minutes': '{0} دقیقه', 'month': 'یک ماه', 'months': '{0} ماه', 'now': 'اکنون', 'second': 'یک لحظه', 'seconds': '{0} ثانیه', 'year': 'یک سال', 'years': '{0} سال'}¶
-
-
class
arrow.locales.
FinnishLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'ma', 'ti', 'ke', 'to', 'pe', 'la', 'su']¶
-
day_names
: ClassVar[List[str]] = ['', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai', 'sunnuntai']¶
-
future
: ClassVar[str] = '{0} kuluttua'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'tammi', 'helmi', 'maalis', 'huhti', 'touko', 'kesä', 'heinä', 'elo', 'syys', 'loka', 'marras', 'joulu']¶
-
month_names
: ClassVar[List[str]] = ['', 'tammikuu', 'helmikuu', 'maaliskuu', 'huhtikuu', 'toukokuu', 'kesäkuu', 'heinäkuu', 'elokuu', 'syyskuu', 'lokakuu', 'marraskuu', 'joulukuu']¶
-
names
: ClassVar[List[str]] = ['fi', 'fi_fi']¶
-
past
: ClassVar[str] = '{0} sitten'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], List[str]]] = {'day': ['päivä', 'päivä'], 'days': ['{0} päivää', '{0} päivän'], 'hour': ['tunti', 'tunnin'], 'hours': ['{0} tuntia', '{0} tunnin'], 'minute': ['minuutti', 'minuutin'], 'minutes': ['{0} minuuttia', '{0} minuutin'], 'month': ['kuukausi', 'kuukauden'], 'months': ['{0} kuukautta', '{0} kuukauden'], 'now': ['juuri nyt', 'juuri nyt'], 'second': ['sekunti', 'sekunti'], 'seconds': ['{0} muutama sekunti', '{0} muutaman sekunnin'], 'year': ['vuosi', 'vuoden'], 'years': ['{0} vuotta', '{0} vuoden']}¶
-
-
class
arrow.locales.
FrenchBaseLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'et'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam', 'dim']¶
-
day_names
: ClassVar[List[str]] = ['', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche']¶
-
future
: ClassVar[str] = 'dans {0}'¶
-
month_names
: ClassVar[List[str]] = ['', 'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre']¶
-
ordinal_day_re
: ClassVar[str] = '((?P<value>\\b1(?=er\\b)|[1-3]?[02-9](?=e\\b)|[1-3]1(?=e\\b))(er|e)\\b)'¶
-
past
: ClassVar[str] = 'il y a {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'un jour', 'days': '{0} jours', 'hour': 'une heure', 'hours': '{0} heures', 'minute': 'une minute', 'minutes': '{0} minutes', 'month': 'un mois', 'months': '{0} mois', 'now': 'maintenant', 'second': 'une seconde', 'seconds': '{0} secondes', 'week': 'une semaine', 'weeks': '{0} semaines', 'year': 'un an', 'years': '{0} ans'}¶
-
-
class
arrow.locales.
FrenchCanadianLocale
¶ -
month_abbreviations
: ClassVar[List[str]] = ['', 'janv', 'févr', 'mars', 'avr', 'mai', 'juin', 'juill', 'août', 'sept', 'oct', 'nov', 'déc']¶
-
names
: ClassVar[List[str]] = ['fr_ca']¶
-
-
class
arrow.locales.
FrenchLocale
¶ -
month_abbreviations
: ClassVar[List[str]] = ['', 'janv', 'févr', 'mars', 'avr', 'mai', 'juin', 'juil', 'août', 'sept', 'oct', 'nov', 'déc']¶
-
names
: ClassVar[List[str]] = ['fr', 'fr_fr']¶
-
-
class
arrow.locales.
GermanBaseLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'und'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So']¶
-
day_names
: ClassVar[List[str]] = ['', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']¶
-
describe
(timeframe, delta=0, only_distance=False)¶ Describes a delta within a timeframe in plain language.
- Parameters
timeframe (
Literal
[‘now’, ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘day’, ‘days’, ‘week’, ‘weeks’, ‘month’, ‘months’, ‘year’, ‘years’, ‘2-hours’, ‘2-days’, ‘2-weeks’, ‘2-months’, ‘2-years’]) – a string representing a timeframe.delta (
Union
[int
,float
]) – a quantity representing a delta in a timeframe.only_distance (
bool
) – return only distance eg: “11 seconds” without “in” or “ago” keywords
- Return type
str
-
future
: ClassVar[str] = 'in {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']¶
-
month_names
: ClassVar[List[str]] = ['', 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']¶
-
past
: ClassVar[str] = 'vor {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'einem Tag', 'days': '{0} Tagen', 'hour': 'einer Stunde', 'hours': '{0} Stunden', 'minute': 'einer Minute', 'minutes': '{0} Minuten', 'month': 'einem Monat', 'months': '{0} Monaten', 'now': 'gerade eben', 'second': 'einer Sekunde', 'seconds': '{0} Sekunden', 'week': 'einer Woche', 'weeks': '{0} Wochen', 'year': 'einem Jahr', 'years': '{0} Jahren'}¶
-
timeframes_only_distance
= {'day': 'ein Tag', 'days': '{0} Tage', 'hour': 'eine Stunde', 'hours': '{0} Stunden', 'minute': 'eine Minute', 'minutes': '{0} Minuten', 'month': 'ein Monat', 'months': '{0} Monate', 'now': 'gerade eben', 'second': 'eine Sekunde', 'seconds': '{0} Sekunden', 'week': 'eine Woche', 'weeks': '{0} Wochen', 'year': 'ein Jahr', 'years': '{0} Jahre'}¶
-
-
class
arrow.locales.
GreekLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'και'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ', 'Κυρ']¶
-
day_names
: ClassVar[List[str]] = ['', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο', 'Κυριακή']¶
-
future
: ClassVar[str] = 'σε {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιον', 'Ιολ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ']¶
-
month_names
: ClassVar[List[str]] = ['', 'Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου']¶
-
names
: ClassVar[List[str]] = ['el', 'el_gr']¶
-
past
: ClassVar[str] = '{0} πριν'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'μία μέρα', 'days': '{0} μέρες', 'hour': 'μία ώρα', 'hours': '{0} ώρες', 'minute': 'ένα λεπτό', 'minutes': '{0} λεπτά', 'month': 'ένα μήνα', 'months': '{0} μήνες', 'now': 'τώρα', 'second': 'ένα δεύτερο', 'seconds': '{0} δευτερόλεπτα', 'year': 'ένα χρόνο', 'years': '{0} χρόνια'}¶
-
-
class
arrow.locales.
HebrewLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'ו'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳', 'א׳']¶
-
day_names
: ClassVar[List[str]] = ['', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת', 'ראשון']¶
-
describe_multi
(timeframes, only_distance=False)¶ Describes a delta within multiple timeframes in plain language. In Hebrew, the and word behaves a bit differently.
- Parameters
timeframes (
Sequence
[Tuple
[Literal
[‘now’, ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘day’, ‘days’, ‘week’, ‘weeks’, ‘month’, ‘months’, ‘year’, ‘years’, ‘2-hours’, ‘2-days’, ‘2-weeks’, ‘2-months’, ‘2-years’],Union
[int
,float
]]]) – a list of string, quantity pairs each representing a timeframe and delta.only_distance (
bool
) – return only distance eg: “2 hours and 11 seconds” without “in” or “ago” keywords
- Return type
str
-
future
: ClassVar[str] = 'בעוד {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'לפני הצהריים', 'PM': 'אחרי הצהריים', 'am': 'לפנ"צ', 'pm': 'אחר"צ'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳']¶
-
month_names
: ClassVar[List[str]] = ['', 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר']¶
-
names
: ClassVar[List[str]] = ['he', 'he_IL']¶
-
past
: ClassVar[str] = 'לפני {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'2-days': 'יומיים', '2-hours': 'שעתיים', '2-months': 'חודשיים', '2-weeks': 'שבועיים', '2-years': 'שנתיים', 'day': 'יום', 'days': '{0} ימים', 'hour': 'שעה', 'hours': '{0} שעות', 'minute': 'דקה', 'minutes': '{0} דקות', 'month': 'חודש', 'months': '{0} חודשים', 'now': 'הרגע', 'second': 'שנייה', 'seconds': '{0} שניות', 'week': 'שבוע', 'weeks': '{0} שבועות', 'year': 'שנה', 'years': '{0} שנים'}¶
-
-
class
arrow.locales.
HindiLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'सोम', 'मंगल', 'बुध', 'गुरुवार', 'शुक्र', 'शनि', 'रवि']¶
-
day_names
: ClassVar[List[str]] = ['', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार', 'रविवार']¶
-
future
: ClassVar[str] = '{0} बाद'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'सुबह', 'PM': 'शाम', 'am': 'सुबह', 'pm': 'शाम'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'जन', 'फ़र', 'मार्च', 'अप्रै', 'मई', 'जून', 'जुलाई', 'आग', 'सित', 'अकत', 'नवे', 'दिस']¶
-
month_names
: ClassVar[List[str]] = ['', 'जनवरी', 'फरवरी', 'मार्च', 'अप्रैल ', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर']¶
-
names
: ClassVar[List[str]] = ['hi']¶
-
past
: ClassVar[str] = '{0} पहले'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'एक दिन', 'days': '{0} दिन', 'hour': 'एक घंटा', 'hours': '{0} घंटे', 'minute': 'एक मिनट ', 'minutes': '{0} मिनट ', 'month': 'एक माह ', 'months': '{0} महीने ', 'now': 'अभी', 'second': 'एक पल', 'seconds': '{0} सेकंड्', 'year': 'एक वर्ष ', 'years': '{0} साल '}¶
-
-
class
arrow.locales.
HongKongLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', '一', '二', '三', '四', '五', '六', '日']¶
-
day_names
: ClassVar[List[str]] = ['', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']¶
-
future
: ClassVar[str] = '{0}後'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', ' 1', ' 2', ' 3', ' 4', ' 5', ' 6', ' 7', ' 8', ' 9', '10', '11', '12']¶
-
month_names
: ClassVar[List[str]] = ['', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']¶
-
names
: ClassVar[List[str]] = ['zh_hk']¶
-
past
: ClassVar[str] = '{0}前'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '1天', 'days': '{0}天', 'hour': '1小時', 'hours': '{0}小時', 'minute': '1分鐘', 'minutes': '{0}分鐘', 'month': '1個月', 'months': '{0}個月', 'now': '剛才', 'second': '1秒', 'seconds': '{0}秒', 'week': '1星期', 'weeks': '{0}星期', 'year': '1年', 'years': '{0}年'}¶
-
-
class
arrow.locales.
HungarianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'hét', 'kedd', 'szer', 'csüt', 'pént', 'szom', 'vas']¶
-
day_names
: ClassVar[List[str]] = ['', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat', 'vasárnap']¶
-
future
: ClassVar[str] = '{0} múlva'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'DE', 'PM': 'DU', 'am': 'de', 'pm': 'du'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'febr', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december']¶
-
names
: ClassVar[List[str]] = ['hu', 'hu_hu']¶
-
past
: ClassVar[str] = '{0} ezelőtt'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Mapping[str, str]]]] = {'day': {'future': 'egy nap', 'past': 'egy nappal'}, 'days': {'future': '{0} nap', 'past': '{0} nappal'}, 'hour': {'future': 'egy óra', 'past': 'egy órával'}, 'hours': {'future': '{0} óra', 'past': '{0} órával'}, 'minute': {'future': 'egy perc', 'past': 'egy perccel'}, 'minutes': {'future': '{0} perc', 'past': '{0} perccel'}, 'month': {'future': 'egy hónap', 'past': 'egy hónappal'}, 'months': {'future': '{0} hónap', 'past': '{0} hónappal'}, 'now': 'éppen most', 'second': {'future': 'egy második', 'past': 'egy második'}, 'seconds': {'future': '{0} pár másodperc', 'past': '{0} másodpercekkel'}, 'year': {'future': 'egy év', 'past': 'egy évvel'}, 'years': {'future': '{0} év', 'past': '{0} évvel'}}¶
-
-
class
arrow.locales.
IcelandicLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau', 'sun']¶
-
day_names
: ClassVar[List[str]] = ['', 'mánudagur', 'þriðjudagur', 'miðvikudagur', 'fimmtudagur', 'föstudagur', 'laugardagur', 'sunnudagur']¶
-
future
: ClassVar[str] = 'eftir {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'f.h.', 'PM': 'e.h.', 'am': 'f.h.', 'pm': 'e.h.'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mar', 'apr', 'maí', 'jún', 'júl', 'ágú', 'sep', 'okt', 'nóv', 'des']¶
-
month_names
: ClassVar[List[str]] = ['', 'janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember']¶
-
names
: ClassVar[List[str]] = ['is', 'is_is']¶
-
past
: ClassVar[str] = 'fyrir {0} síðan'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[Tuple[str, str], str]]] = {'day': ('einum degi', 'einn dag'), 'days': ('{0} dögum', '{0} daga'), 'hour': ('einum tíma', 'einn tíma'), 'hours': ('{0} tímum', '{0} tíma'), 'minute': ('einni mínútu', 'eina mínútu'), 'minutes': ('{0} mínútum', '{0} mínútur'), 'month': ('einum mánuði', 'einn mánuð'), 'months': ('{0} mánuðum', '{0} mánuði'), 'now': 'rétt í þessu', 'second': ('sekúndu', 'sekúndu'), 'seconds': ('{0} nokkrum sekúndum', 'nokkrar sekúndur'), 'year': ('einu ári', 'eitt ár'), 'years': ('{0} árum', '{0} ár')}¶
-
-
class
arrow.locales.
IndonesianLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'dan'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', 'Minggu']¶
-
day_names
: ClassVar[List[str]] = ['', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', 'Minggu']¶
-
future
: ClassVar[str] = 'dalam {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': '', 'PM': '', 'am': '', 'pm': ''}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sept', 'Okt', 'Nov', 'Des']¶
-
month_names
: ClassVar[List[str]] = ['', 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember']¶
-
names
: ClassVar[List[str]] = ['id', 'id_id']¶
-
past
: ClassVar[str] = '{0} yang lalu'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '1 hari', 'days': '{0} hari', 'hour': '1 jam', 'hours': '{0} jam', 'minute': '1 menit', 'minutes': '{0} menit', 'month': '1 bulan', 'months': '{0} bulan', 'now': 'baru saja', 'second': '1 sebentar', 'seconds': '{0} detik', 'year': '1 tahun', 'years': '{0} tahun'}¶
-
-
class
arrow.locales.
ItalianLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'e'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab', 'dom']¶
-
day_names
: ClassVar[List[str]] = ['', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato', 'domenica']¶
-
future
: ClassVar[str] = 'tra {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic']¶
-
month_names
: ClassVar[List[str]] = ['', 'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre']¶
-
names
: ClassVar[List[str]] = ['it', 'it_it']¶
-
ordinal_day_re
: ClassVar[str] = '((?P<value>[1-3]?[0-9](?=[ºª]))[ºª])'¶
-
past
: ClassVar[str] = '{0} fa'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'un giorno', 'days': '{0} giorni', 'hour': "un'ora", 'hours': '{0} ore', 'minute': 'un minuto', 'minutes': '{0} minuti', 'month': 'un mese', 'months': '{0} mesi', 'now': 'adesso', 'second': 'un secondo', 'seconds': '{0} qualche secondo', 'week': 'una settimana,', 'weeks': '{0} settimane', 'year': 'un anno', 'years': '{0} anni'}¶
-
-
class
arrow.locales.
JapaneseLocale
¶ -
and_word
: ClassVar[Optional[str]] = ''¶
-
day_abbreviations
: ClassVar[List[str]] = ['', '月', '火', '水', '木', '金', '土', '日']¶
-
day_names
: ClassVar[List[str]] = ['', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', '日曜日']¶
-
future
: ClassVar[str] = '{0}後'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', ' 1', ' 2', ' 3', ' 4', ' 5', ' 6', ' 7', ' 8', ' 9', '10', '11', '12']¶
-
month_names
: ClassVar[List[str]] = ['', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']¶
-
names
: ClassVar[List[str]] = ['ja', 'ja_jp']¶
-
past
: ClassVar[str] = '{0}前'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '1日', 'days': '{0}日', 'hour': '1時間', 'hours': '{0}時間', 'minute': '1分', 'minutes': '{0}分', 'month': '1ヶ月', 'months': '{0}ヶ月', 'now': '現在', 'second': '1秒', 'seconds': '{0}秒', 'week': '1週間', 'weeks': '{0}週間', 'year': '1年', 'years': '{0}年'}¶
-
-
class
arrow.locales.
KoreanLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', '월', '화', '수', '목', '금', '토', '일']¶
-
day_names
: ClassVar[List[str]] = ['', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일', '일요일']¶
-
future
: ClassVar[str] = '{0} 후'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', ' 1', ' 2', ' 3', ' 4', ' 5', ' 6', ' 7', ' 8', ' 9', '10', '11', '12']¶
-
month_names
: ClassVar[List[str]] = ['', '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']¶
-
names
: ClassVar[List[str]] = ['ko', 'ko_kr']¶
-
past
: ClassVar[str] = '{0} 전'¶
-
special_dayframes
= {-3: '그끄제', -2: '그제', -1: '어제', 1: '내일', 2: '모레', 3: '글피', 4: '그글피'}¶
-
special_yearframes
= {-2: '제작년', -1: '작년', 1: '내년', 2: '내후년'}¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '하루', 'days': '{0}일', 'hour': '한시간', 'hours': '{0}시간', 'minute': '1분', 'minutes': '{0}분', 'month': '한달', 'months': '{0}개월', 'now': '지금', 'second': '1초', 'seconds': '{0}초', 'week': '1주', 'weeks': '{0}주', 'year': '1년', 'years': '{0}년'}¶
-
-
class
arrow.locales.
LevantArabicLocale
¶ -
month_abbreviations
: ClassVar[List[str]] = ['', 'كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول']¶
-
month_names
: ClassVar[List[str]] = ['', 'كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول']¶
-
names
: ClassVar[List[str]] = ['ar_iq', 'ar_jo', 'ar_lb', 'ar_ps', 'ar_sy']¶
-
-
class
arrow.locales.
Locale
¶ Represents locale-specific data and functionality.
-
and_word
: ClassVar[Optional[str]] = None¶
-
day_abbreviation
(day)¶ Returns the day abbreviation for a specified day of the week.
- Parameters
day (
int
) – theint
day of the week (1-7).- Return type
str
-
day_abbreviations
: ClassVar[List[str]] = []¶
-
day_name
(day)¶ Returns the day name for a specified day of the week.
- Parameters
day (
int
) – theint
day of the week (1-7).- Return type
str
-
day_names
: ClassVar[List[str]] = []¶
-
describe
(timeframe, delta=0, only_distance=False)¶ Describes a delta within a timeframe in plain language.
- Parameters
timeframe (
Literal
[‘now’, ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘day’, ‘days’, ‘week’, ‘weeks’, ‘month’, ‘months’, ‘year’, ‘years’, ‘2-hours’, ‘2-days’, ‘2-weeks’, ‘2-months’, ‘2-years’]) – a string representing a timeframe.delta (
Union
[float
,int
]) – a quantity representing a delta in a timeframe.only_distance (
bool
) – return only distance eg: “11 seconds” without “in” or “ago” keywords
- Return type
str
-
describe_multi
(timeframes, only_distance=False)¶ Describes a delta within multiple timeframes in plain language.
- Parameters
timeframes (
Sequence
[Tuple
[Literal
[‘now’, ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘day’, ‘days’, ‘week’, ‘weeks’, ‘month’, ‘months’, ‘year’, ‘years’, ‘2-hours’, ‘2-days’, ‘2-weeks’, ‘2-months’, ‘2-years’],Union
[int
,float
]]]) – a list of string, quantity pairs each representing a timeframe and delta.only_distance (
bool
) – return only distance eg: “2 hours and 11 seconds” without “in” or “ago” keywords
- Return type
str
-
future
: ClassVar[str]¶
-
meridian
(hour, token)¶ Returns the meridian indicator for a specified hour and format token.
- Parameters
hour (
int
) – theint
hour of the day.token (
Any
) – the format token.
- Return type
Optional
[str
]
-
meridians
: ClassVar[Dict[str, str]] = {'AM': '', 'PM': '', 'am': '', 'pm': ''}¶
-
month_abbreviation
(month)¶ Returns the month abbreviation for a specified month of the year.
- Parameters
month (
int
) – theint
month of the year (1-12).- Return type
str
-
month_abbreviations
: ClassVar[List[str]] = []¶
-
month_name
(month)¶ Returns the month name for a specified month of the year.
- Parameters
month (
int
) – theint
month of the year (1-12).- Return type
str
-
month_names
: ClassVar[List[str]] = []¶
-
month_number
(name)¶ Returns the month number for a month specified by name or abbreviation.
- Parameters
name (
str
) – the month name or abbreviation.- Return type
Optional
[int
]
-
names
: ClassVar[List[str]] = []¶
-
ordinal_day_re
: ClassVar[str] = '(\\d+)'¶
-
ordinal_number
(n)¶ Returns the ordinal format of a given integer
- Parameters
n (
int
) – an integer- Return type
str
-
past
: ClassVar[str]¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '', 'days': '', 'hour': '', 'hours': '', 'minute': '', 'minutes': '', 'month': '', 'months': '', 'now': '', 'second': '', 'seconds': '', 'week': '', 'weeks': '', 'year': '', 'years': ''}¶
-
year_abbreviation
(year)¶ Returns the year for specific locale if available
- Parameters
year (
int
) – theint
year (4-digit)- Return type
str
-
year_full
(year)¶ Returns the year for specific locale if available
- Parameters
year (
int
) – theint
year (4-digit)- Return type
str
-
-
class
arrow.locales.
MacedonianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Пон', 'Вт', 'Сре', 'Чет', 'Пет', 'Саб', 'Нед']¶
-
day_names
: ClassVar[List[str]] = ['', 'Понеделник', 'Вторник', 'Среда', 'Четврток', 'Петок', 'Сабота', 'Недела']¶
-
future
: ClassVar[str] = 'за {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'претпладне', 'PM': 'попладне', 'am': 'дп', 'pm': 'пп'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Јан', 'Фев', 'Мар', 'Апр', 'Мај', 'Јун', 'Јул', 'Авг', 'Септ', 'Окт', 'Ноем', 'Декем']¶
-
month_names
: ClassVar[List[str]] = ['', 'Јануари', 'Февруари', 'Март', 'Април', 'Мај', 'Јуни', 'Јули', 'Август', 'Септември', 'Октомври', 'Ноември', 'Декември']¶
-
names
: ClassVar[List[str]] = ['mk', 'mk_mk']¶
-
past
: ClassVar[str] = 'пред {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, List[str]]]] = {'day': 'еден ден', 'days': ['{0} ден', '{0} дена', '{0} дена'], 'hour': 'еден саат', 'hours': ['{0} саат', '{0} саати', '{0} саати'], 'minute': 'една минута', 'minutes': ['{0} минута', '{0} минути', '{0} минути'], 'month': 'еден месец', 'months': ['{0} месец', '{0} месеци', '{0} месеци'], 'now': 'сега', 'second': 'една секунда', 'seconds': ['{0} секунда', '{0} секунди', '{0} секунди'], 'week': 'една недела', 'weeks': ['{0} недела', '{0} недели', '{0} недели'], 'year': 'една година', 'years': ['{0} година', '{0} години', '{0} години']}¶
-
-
class
arrow.locales.
MalayalamLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'തിങ്കള്\u200d', 'ചൊവ്വ', 'ബുധന്\u200d', 'വ്യാഴം', 'വെള്ളി', 'ശനി', 'ഞായര്\u200d']¶
-
day_names
: ClassVar[List[str]] = ['', 'തിങ്കള്\u200d', 'ചൊവ്വ', 'ബുധന്\u200d', 'വ്യാഴം', 'വെള്ളി', 'ശനി', 'ഞായര്\u200d']¶
-
future
: ClassVar[str] = '{0} ശേഷം'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'രാവിലെ', 'PM': 'ഉച്ചക്ക് ശേഷം', 'am': 'രാവിലെ', 'pm': 'ഉച്ചക്ക് ശേഷം'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'ജനു', 'ഫെബ് ', 'മാർ', 'ഏപ്രിൽ', 'മേയ്', 'ജൂണ്\u200d', 'ജൂലൈ', 'ഓഗസ്റ', 'സെപ്റ്റ', 'ഒക്ടോ', 'നവം', 'ഡിസം']¶
-
month_names
: ClassVar[List[str]] = ['', 'ജനുവരി', 'ഫെബ്രുവരി', 'മാർച്ച്\u200c', 'ഏപ്രിൽ ', 'മെയ്\u200c ', 'ജൂണ്\u200d', 'ജൂലൈ', 'ഓഗസ്റ്റ്\u200c', 'സെപ്റ്റംബർ', 'ഒക്ടോബർ', 'നവംബർ', 'ഡിസംബർ']¶
-
names
: ClassVar[List[str]] = ['ml']¶
-
past
: ClassVar[str] = '{0} മുമ്പ്'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'ഒരു ദിവസം ', 'days': '{0} ദിവസം ', 'hour': 'ഒരു മണിക്കൂർ', 'hours': '{0} മണിക്കൂർ', 'minute': 'ഒരു മിനിറ്റ്', 'minutes': '{0} മിനിറ്റ്', 'month': 'ഒരു മാസം ', 'months': '{0} മാസം ', 'now': 'ഇപ്പോൾ', 'second': 'ഒരു നിമിഷം', 'seconds': '{0} സെക്കന്റ്\u200c', 'year': 'ഒരു വർഷം ', 'years': '{0} വർഷം '}¶
-
-
class
arrow.locales.
MarathiLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'सोम', 'मंगळ', 'बुध', 'गुरु', 'शुक्र', 'शनि', 'रवि']¶
-
day_names
: ClassVar[List[str]] = ['', 'सोमवार', 'मंगळवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार', 'रविवार']¶
-
future
: ClassVar[str] = '{0} नंतर'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'सकाळ', 'PM': 'संध्याकाळ', 'am': 'सकाळ', 'pm': 'संध्याकाळ'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'जान', 'फेब्रु', 'मार्च', 'एप्रि', 'मे', 'जून', 'जुलै', 'अॉग', 'सप्टें', 'अॉक्टो', 'नोव्हें', 'डिसें']¶
-
month_names
: ClassVar[List[str]] = ['', 'जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'अॉगस्ट', 'सप्टेंबर', 'अॉक्टोबर', 'नोव्हेंबर', 'डिसेंबर']¶
-
names
: ClassVar[List[str]] = ['mr']¶
-
past
: ClassVar[str] = '{0} आधी'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'एक दिवस', 'days': '{0} दिवस', 'hour': 'एक तास', 'hours': '{0} तास', 'minute': 'एक मिनिट ', 'minutes': '{0} मिनिट ', 'month': 'एक महिना ', 'months': '{0} महिने ', 'now': 'सद्य', 'second': 'एक सेकंद', 'seconds': '{0} सेकंद', 'year': 'एक वर्ष ', 'years': '{0} वर्ष '}¶
-
-
class
arrow.locales.
MauritaniaArabicLocale
¶ -
month_abbreviations
: ClassVar[List[str]] = ['', 'يناير', 'فبراير', 'مارس', 'إبريل', 'مايو', 'يونيو', 'يوليو', 'أغشت', 'شتمبر', 'أكتوبر', 'نوفمبر', 'دجمبر']¶
-
month_names
: ClassVar[List[str]] = ['', 'يناير', 'فبراير', 'مارس', 'إبريل', 'مايو', 'يونيو', 'يوليو', 'أغشت', 'شتمبر', 'أكتوبر', 'نوفمبر', 'دجمبر']¶
-
names
: ClassVar[List[str]] = ['ar_mr']¶
-
-
class
arrow.locales.
MoroccoArabicLocale
¶ -
month_abbreviations
: ClassVar[List[str]] = ['', 'يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر']¶
-
month_names
: ClassVar[List[str]] = ['', 'يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر']¶
-
names
: ClassVar[List[str]] = ['ar_ma']¶
-
-
class
arrow.locales.
NepaliLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'सोम', 'मंगल', 'बुध', 'बिहि', 'शुक्र', 'शनि', 'आइत']¶
-
day_names
: ClassVar[List[str]] = ['', 'सोमवार', 'मंगलवार', 'बुधवार', 'बिहिवार', 'शुक्रवार', 'शनिवार', 'आइतवार']¶
-
future
: ClassVar[str] = '{0} पछी'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'पूर्वाह्न', 'PM': 'अपरान्ह', 'am': 'पूर्वाह्न', 'pm': 'अपरान्ह'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'जन', 'फेब', 'मार्च', 'एप्रील', 'मे', 'जुन', 'जुलाई', 'अग', 'सेप', 'अक्ट', 'नोव', 'डिस']¶
-
month_names
: ClassVar[List[str]] = ['', 'जनवरी', 'फेब्रुअरी', 'मार्च', 'एप्रील', 'मे', 'जुन', 'जुलाई', 'अगष्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोवेम्बर', 'डिसेम्बर']¶
-
names
: ClassVar[List[str]] = ['ne', 'ne_np']¶
-
past
: ClassVar[str] = '{0} पहिले'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'एक दिन', 'days': '{0} दिन', 'hour': 'एक घण्टा', 'hours': '{0} घण्टा', 'minute': 'मिनेट', 'minutes': '{0} मिनेट', 'month': 'एक महिना', 'months': '{0} महिना', 'now': 'अहिले', 'second': 'एक सेकेन्ड', 'seconds': '{0} सेकण्ड', 'year': 'एक बर्ष', 'years': 'बर्ष'}¶
-
-
class
arrow.locales.
NewNorwegianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'må', 'ty', 'on', 'to', 'fr', 'la', 'su']¶
-
day_names
: ClassVar[List[str]] = ['', 'måndag', 'tysdag', 'onsdag', 'torsdag', 'fredag', 'laurdag', 'sundag']¶
-
future
: ClassVar[str] = 'om {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des']¶
-
month_names
: ClassVar[List[str]] = ['', 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember']¶
-
names
: ClassVar[List[str]] = ['nn', 'nn_no']¶
-
past
: ClassVar[str] = 'for {0} sidan'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'ein dag', 'days': '{0} dagar', 'hour': 'ein time', 'hours': '{0} timar', 'minute': 'eitt minutt', 'minutes': '{0} minutt', 'month': 'en månad', 'months': '{0} månader', 'now': 'no nettopp', 'second': 'eitt sekund', 'seconds': '{0} sekund', 'year': 'eitt år', 'years': '{0} år'}¶
-
-
class
arrow.locales.
NorwegianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'ma', 'ti', 'on', 'to', 'fr', 'lø', 'sø']¶
-
day_names
: ClassVar[List[str]] = ['', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', 'søndag']¶
-
future
: ClassVar[str] = 'om {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des']¶
-
month_names
: ClassVar[List[str]] = ['', 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember']¶
-
names
: ClassVar[List[str]] = ['nb', 'nb_no']¶
-
past
: ClassVar[str] = 'for {0} siden'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'en dag', 'days': '{0} dager', 'hour': 'en time', 'hours': '{0} timer', 'minute': 'ett minutt', 'minutes': '{0} minutter', 'month': 'en måned', 'months': '{0} måneder', 'now': 'nå nettopp', 'second': 'ett sekund', 'seconds': '{0} sekunder', 'year': 'ett år', 'years': '{0} år'}¶
-
-
class
arrow.locales.
PolishLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Pn', 'Wt', 'Śr', 'Czw', 'Pt', 'So', 'Nd']¶
-
day_names
: ClassVar[List[str]] = ['', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota', 'niedziela']¶
-
future
: ClassVar[str] = 'za {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru']¶
-
month_names
: ClassVar[List[str]] = ['', 'styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień']¶
-
names
: ClassVar[List[str]] = ['pl', 'pl_pl']¶
-
past
: ClassVar[str] = '{0} temu'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, List[str]]]] = {'day': 'dzień', 'days': '{0} dni', 'hour': 'godzinę', 'hours': ['{0} godzin', '{0} godziny', '{0} godzin'], 'minute': 'minutę', 'minutes': ['{0} minut', '{0} minuty', '{0} minut'], 'month': 'miesiąc', 'months': ['{0} miesięcy', '{0} miesiące', '{0} miesięcy'], 'now': 'teraz', 'second': 'sekundę', 'seconds': ['{0} sekund', '{0} sekundy', '{0} sekund'], 'week': 'tydzień', 'weeks': ['{0} tygodni', '{0} tygodnie', '{0} tygodni'], 'year': 'rok', 'years': ['{0} lat', '{0} lata', '{0} lat']}¶
-
-
class
arrow.locales.
PortugueseLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'e'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab', 'Dom']¶
-
day_names
: ClassVar[List[str]] = ['', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado', 'Domingo']¶
-
future
: ClassVar[str] = 'em {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']¶
-
month_names
: ClassVar[List[str]] = ['', 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro']¶
-
names
: ClassVar[List[str]] = ['pt', 'pt_pt']¶
-
past
: ClassVar[str] = 'há {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'um dia', 'days': '{0} dias', 'hour': 'uma hora', 'hours': '{0} horas', 'minute': 'um minuto', 'minutes': '{0} minutos', 'month': 'um mês', 'months': '{0} meses', 'now': 'agora', 'second': 'um segundo', 'seconds': '{0} segundos', 'week': 'uma semana', 'weeks': '{0} semanas', 'year': 'um ano', 'years': '{0} anos'}¶
-
-
class
arrow.locales.
RomanianLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'și'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm', 'Dum']¶
-
day_names
: ClassVar[List[str]] = ['', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă', 'duminică']¶
-
future
: ClassVar[str] = 'peste {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'ian', 'febr', 'mart', 'apr', 'mai', 'iun', 'iul', 'aug', 'sept', 'oct', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie']¶
-
names
: ClassVar[List[str]] = ['ro', 'ro_ro']¶
-
past
: ClassVar[str] = '{0} în urmă'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'o zi', 'days': '{0} zile', 'hour': 'o oră', 'hours': '{0} ore', 'minute': 'un minut', 'minutes': '{0} minute', 'month': 'o lună', 'months': '{0} luni', 'now': 'acum', 'second': 'o secunda', 'seconds': '{0} câteva secunde', 'year': 'un an', 'years': '{0} ani'}¶
-
-
class
arrow.locales.
RomanshLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'gli', 'ma', 'me', 'gie', 've', 'so', 'du']¶
-
day_names
: ClassVar[List[str]] = ['', 'glindesdi', 'mardi', 'mesemna', 'gievgia', 'venderdi', 'sonda', 'dumengia']¶
-
future
: ClassVar[str] = 'en {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'schan', 'fav', 'mars', 'avr', 'matg', 'zer', 'fan', 'avu', 'set', 'oct', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'schaner', 'favrer', 'mars', 'avrigl', 'matg', 'zercladur', 'fanadur', 'avust', 'settember', 'october', 'november', 'december']¶
-
names
: ClassVar[List[str]] = ['rm', 'rm_ch']¶
-
past
: ClassVar[str] = 'avant {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'in di', 'days': '{0} dis', 'hour': "in'ura", 'hours': '{0} ura', 'minute': 'ina minuta', 'minutes': '{0} minutas', 'month': 'in mais', 'months': '{0} mais', 'now': 'en quest mument', 'second': 'in secunda', 'seconds': '{0} secundas', 'year': 'in onn', 'years': '{0} onns'}¶
-
-
class
arrow.locales.
RussianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', 'вс']¶
-
day_names
: ClassVar[List[str]] = ['', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота', 'воскресенье']¶
-
future
: ClassVar[str] = 'через {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек']¶
-
month_names
: ClassVar[List[str]] = ['', 'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря']¶
-
names
: ClassVar[List[str]] = ['ru', 'ru_ru']¶
-
past
: ClassVar[str] = '{0} назад'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, List[str]]]] = {'day': 'день', 'days': ['{0} день', '{0} дня', '{0} дней'], 'hour': 'час', 'hours': ['{0} час', '{0} часа', '{0} часов'], 'minute': 'минуту', 'minutes': ['{0} минуту', '{0} минуты', '{0} минут'], 'month': 'месяц', 'months': ['{0} месяц', '{0} месяца', '{0} месяцев'], 'now': 'сейчас', 'second': 'Второй', 'seconds': '{0} несколько секунд', 'week': 'неделю', 'weeks': ['{0} неделю', '{0} недели', '{0} недель'], 'year': 'год', 'years': ['{0} год', '{0} года', '{0} лет']}¶
-
-
class
arrow.locales.
SlavicBaseLocale
¶
-
class
arrow.locales.
SlovakLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'a'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'po', 'ut', 'st', 'št', 'pi', 'so', 'ne']¶
-
day_names
: ClassVar[List[str]] = ['', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota', 'nedeľa']¶
-
future
: ClassVar[str] = 'O {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december']¶
-
names
: ClassVar[List[str]] = ['sk', 'sk_sk']¶
-
past
: ClassVar[str] = 'Pred {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[Mapping[str, Union[List[str], str]], str]]] = {'day': {'future': 'deň', 'past': 'dňom', 'zero': '{0} dní'}, 'days': {'future': ['{0} dni', '{0} dní'], 'past': '{0} dňami'}, 'hour': {'future': 'hodinu', 'past': 'hodinou', 'zero': '{0} hodín'}, 'hours': {'future': ['{0} hodiny', '{0} hodín'], 'past': '{0} hodinami'}, 'minute': {'future': 'minútu', 'past': 'minútou', 'zero': '{0} minút'}, 'minutes': {'future': ['{0} minúty', '{0} minút'], 'past': '{0} minútami'}, 'month': {'future': 'mesiac', 'past': 'mesiacom', 'zero': '{0} mesiacov'}, 'months': {'future': ['{0} mesiace', '{0} mesiacov'], 'past': '{0} mesiacmi'}, 'now': 'Teraz', 'second': {'future': 'sekundu', 'past': 'sekundou', 'zero': '{0} sekúnd'}, 'seconds': {'future': ['{0} sekundy', '{0} sekúnd'], 'past': '{0} sekundami'}, 'week': {'future': 'týždeň', 'past': 'týždňom', 'zero': '{0} týždňov'}, 'weeks': {'future': ['{0} týždne', '{0} týždňov'], 'past': '{0} týždňami'}, 'year': {'future': 'rok', 'past': 'rokom', 'zero': '{0} rokov'}, 'years': {'future': ['{0} roky', '{0} rokov'], 'past': '{0} rokmi'}}¶
-
-
class
arrow.locales.
SlovenianLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'in'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Pon', 'Tor', 'Sre', 'Čet', 'Pet', 'Sob', 'Ned']¶
-
day_names
: ClassVar[List[str]] = ['', 'Ponedeljek', 'Torek', 'Sreda', 'Četrtek', 'Petek', 'Sobota', 'Nedelja']¶
-
future
: ClassVar[str] = 'čez {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': '', 'PM': '', 'am': '', 'pm': ''}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'Januar', 'Februar', 'Marec', 'April', 'Maj', 'Junij', 'Julij', 'Avgust', 'September', 'Oktober', 'November', 'December']¶
-
names
: ClassVar[List[str]] = ['sl', 'sl_si']¶
-
past
: ClassVar[str] = 'pred {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'dan', 'days': '{0} dni', 'hour': 'uro', 'hours': '{0} ur', 'minute': 'minuta', 'minutes': '{0} minutami', 'month': 'mesec', 'months': '{0} mesecev', 'now': 'zdaj', 'second': 'sekundo', 'seconds': '{0} sekund', 'year': 'leto', 'years': '{0} let'}¶
-
-
class
arrow.locales.
SpanishLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'y'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'lun', 'mar', 'mie', 'jue', 'vie', 'sab', 'dom']¶
-
day_names
: ClassVar[List[str]] = ['', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', 'domingo']¶
-
future
: ClassVar[str] = 'en {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'AM', 'PM': 'PM', 'am': 'am', 'pm': 'pm'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic']¶
-
month_names
: ClassVar[List[str]] = ['', 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre']¶
-
names
: ClassVar[List[str]] = ['es', 'es_es']¶
-
ordinal_day_re
: ClassVar[str] = '((?P<value>[1-3]?[0-9](?=[ºª]))[ºª])'¶
-
past
: ClassVar[str] = 'hace {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'un día', 'days': '{0} días', 'hour': 'una hora', 'hours': '{0} horas', 'minute': 'un minuto', 'minutes': '{0} minutos', 'month': 'un mes', 'months': '{0} meses', 'now': 'ahora', 'second': 'un segundo', 'seconds': '{0} segundos', 'week': 'una semana', 'weeks': '{0} semanas', 'year': 'un año', 'years': '{0} años'}¶
-
-
class
arrow.locales.
SwahiliLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'na'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi', 'Jumapili']¶
-
day_names
: ClassVar[List[str]] = ['', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi', 'Jumapili']¶
-
future
: ClassVar[str] = 'muda wa {0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'ASU', 'PM': 'MCH', 'am': 'asu', 'pm': 'mch'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des']¶
-
month_names
: ClassVar[List[str]] = ['', 'Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba']¶
-
names
: ClassVar[List[str]] = ['sw', 'sw_ke', 'sw_tz']¶
-
past
: ClassVar[str] = '{0} iliyopita'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'siku moja', 'days': 'siku {0}', 'hour': 'saa moja', 'hours': 'saa {0}', 'minute': 'dakika moja', 'minutes': 'dakika {0}', 'month': 'mwezi moja', 'months': 'miezi {0}', 'now': 'sasa hivi', 'second': 'sekunde', 'seconds': 'sekunde {0}', 'week': 'wiki moja', 'weeks': 'wiki {0}', 'year': 'mwaka moja', 'years': 'miaka {0}'}¶
-
-
class
arrow.locales.
SwedishLocale
¶ -
and_word
: ClassVar[Optional[str]] = 'och'¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör', 'sön']¶
-
day_names
: ClassVar[List[str]] = ['', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag', 'söndag']¶
-
future
: ClassVar[str] = 'om {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec']¶
-
month_names
: ClassVar[List[str]] = ['', 'januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december']¶
-
names
: ClassVar[List[str]] = ['sv', 'sv_se']¶
-
past
: ClassVar[str] = 'för {0} sen'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'en dag', 'days': '{0} dagar', 'hour': 'en timme', 'hours': '{0} timmar', 'minute': 'en minut', 'minutes': '{0} minuter', 'month': 'en månad', 'months': '{0} månader', 'now': 'just nu', 'second': 'en sekund', 'seconds': '{0} några sekunder', 'week': 'en vecka', 'weeks': '{0} veckor', 'year': 'ett år', 'years': '{0} år'}¶
-
-
class
arrow.locales.
TagalogLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab', 'Lin']¶
-
day_names
: ClassVar[List[str]] = ['', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado', 'Linggo']¶
-
future
: ClassVar[str] = '{0} mula ngayon'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'ng umaga', 'PM': 'ng hapon', 'am': 'nu', 'pm': 'nh'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis']¶
-
month_names
: ClassVar[List[str]] = ['', 'Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre']¶
-
names
: ClassVar[List[str]] = ['tl', 'tl_ph']¶
-
past
: ClassVar[str] = 'nakaraang {0}'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'isang araw', 'days': '{0} araw', 'hour': 'isang oras', 'hours': '{0} oras', 'minute': 'isang minuto', 'minutes': '{0} minuto', 'month': 'isang buwan', 'months': '{0} buwan', 'now': 'ngayon lang', 'second': 'isang segundo', 'seconds': '{0} segundo', 'week': 'isang linggo', 'weeks': '{0} linggo', 'year': 'isang taon', 'years': '{0} taon'}¶
-
-
class
arrow.locales.
ThaiLocale
¶ -
BE_OFFSET
= 543¶
-
day_abbreviations
: ClassVar[List[str]] = ['', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส', 'อา']¶
-
day_names
: ClassVar[List[str]] = ['', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์', 'อาทิตย์']¶
-
future
: ClassVar[str] = 'ในอีก{1}{0}'¶
-
meridians
: ClassVar[Dict[str, str]] = {'AM': 'AM', 'PM': 'PM', 'am': 'am', 'pm': 'pm'}¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.']¶
-
month_names
: ClassVar[List[str]] = ['', 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม']¶
-
names
: ClassVar[List[str]] = ['th', 'th_th']¶
-
past
: ClassVar[str] = '{0}{1}ที่ผ่านมา'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': '1 วัน', 'days': '{0} วัน', 'hour': '1 ชั่วโมง', 'hours': '{0} ชั่วโมง', 'minute': '1 นาที', 'minutes': '{0} นาที', 'month': '1 เดือน', 'months': '{0} เดือน', 'now': 'ขณะนี้', 'second': 'วินาที', 'seconds': '{0} ไม่กี่วินาที', 'year': '1 ปี', 'years': '{0} ปี'}¶
-
year_abbreviation
(year)¶ Thai always use Buddhist Era (BE) which is CE + 543
- Return type
str
-
year_full
(year)¶ Thai always use Buddhist Era (BE) which is CE + 543
- Return type
str
-
-
class
arrow.locales.
TurkishLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt', 'Paz']¶
-
day_names
: ClassVar[List[str]] = ['', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi', 'Pazar']¶
-
future
: ClassVar[str] = '{0} sonra'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara']¶
-
month_names
: ClassVar[List[str]] = ['', 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık']¶
-
names
: ClassVar[List[str]] = ['tr', 'tr_tr']¶
-
past
: ClassVar[str] = '{0} önce'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'bir gün', 'days': '{0} gün', 'hour': 'bir saat', 'hours': '{0} saat', 'minute': 'bir dakika', 'minutes': '{0} dakika', 'month': 'bir ay', 'months': '{0} ay', 'now': 'şimdi', 'second': 'bir saniye', 'seconds': '{0} saniye', 'year': 'yıl', 'years': '{0} yıl'}¶
-
-
class
arrow.locales.
UkrainianLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб', 'нд']¶
-
day_names
: ClassVar[List[str]] = ['', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота', 'неділя']¶
-
future
: ClassVar[str] = 'за {0}'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'січ', 'лют', 'бер', 'квіт', 'трав', 'черв', 'лип', 'серп', 'вер', 'жовт', 'лист', 'груд']¶
-
month_names
: ClassVar[List[str]] = ['', 'січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня']¶
-
names
: ClassVar[List[str]] = ['ua', 'uk_ua']¶
-
past
: ClassVar[str] = '{0} тому'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, List[str]]]] = {'day': 'день', 'days': ['{0} день', '{0} дні', '{0} днів'], 'hour': 'годину', 'hours': ['{0} годину', '{0} години', '{0} годин'], 'minute': 'хвилину', 'minutes': ['{0} хвилину', '{0} хвилини', '{0} хвилин'], 'month': 'місяць', 'months': ['{0} місяць', '{0} місяці', '{0} місяців'], 'now': 'зараз', 'second': 'секунда', 'seconds': '{0} кілька секунд', 'year': 'рік', 'years': ['{0} рік', '{0} роки', '{0} років']}¶
-
-
class
arrow.locales.
VietnameseLocale
¶ -
day_abbreviations
: ClassVar[List[str]] = ['', 'Thứ 2', 'Thứ 3', 'Thứ 4', 'Thứ 5', 'Thứ 6', 'Thứ 7', 'CN']¶
-
day_names
: ClassVar[List[str]] = ['', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy', 'Chủ Nhật']¶
-
future
: ClassVar[str] = '{0} nữa'¶
-
month_abbreviations
: ClassVar[List[str]] = ['', 'Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12']¶
-
month_names
: ClassVar[List[str]] = ['', 'Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu', 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai']¶
-
names
: ClassVar[List[str]] = ['vi', 'vi_vn']¶
-
past
: ClassVar[str] = '{0} trước'¶
-
timeframes
: ClassVar[Mapping[typing_extensions.Literal[now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years, 2-hours, 2-days, 2-weeks, 2-months, 2-years], Union[str, Sequence[str], Mapping[str, str], Mapping[str, Sequence[str]]]]] = {'day': 'một ngày', 'days': '{0} ngày', 'hour': 'một giờ', 'hours': '{0} giờ', 'minute': 'một phút', 'minutes': '{0} phút', 'month': 'một tháng', 'months': '{0} tháng', 'now': 'hiện tại', 'second': 'một giây', 'seconds': '{0} giây', 'week': 'một tuần', 'weeks': '{0} tuần', 'year': 'một năm', 'years': '{0} năm'}¶
-
Release History¶
- Changelog
- 1.0.0 (2021-02-24)
- 0.17.0 (2020-10-2)
- 0.16.0 (2020-08-23)
- 0.15.8 (2020-07-23)
- 0.15.7 (2020-06-19)
- 0.15.6 (2020-04-29)
- 0.15.5 (2020-01-03)
- 0.15.4 (2019-11-02)
- 0.15.3 (2019-11-02)
- 0.15.2 (2019-09-14)
- 0.15.1 (2019-09-10)
- 0.15.0 (2019-09-08)
- 0.14.7 (2019-09-04)
- 0.14.6 (2019-08-28)
- 0.14.5 (2019-08-09)
- 0.14.4 (2019-07-30)
- 0.14.3 (2019-07-28)
- 0.14.2 (2019-06-06)
- 0.14.1 (2019-06-06)
- 0.14.0 (2019-06-06)
- 0.13.2 (2019-05-30)
- 0.13.1 (2019-02-17)
- 0.13.0 (2019-01-09)
- 0.12.1
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.1 - 0.5.4
- 0.5.0
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.6
- 0.1.5