Closed loverdos closed 3 years ago
Hi @loverdos, thanks for bringing this up. This is actually a part of the documentation we forgot to update for the v1.0 release. We now have a few ways to access timestamps:
env ❯ python3
Python 3.9.2 (default, Feb 19 2021, 17:43:04)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>> arrow.__version__
'1.0.1'
>>> now = arrow.now()
>>> now
<Arrow [2021-02-27T14:06:09.855717-05:00]>
>>> now.timestamp()
1614452769.855717
>>> now.int_timestamp
1614452769
>>> now.float_timestamp
1614452769.855717
The int_timestamp
and float_timestamp
properties were added in v1.0 for legacy purposes. The primary way to access timestamps is to now use the function.
Issue Description
In the documentation,
timestamp
is treated as a property and so no parentheses are used but in the code it is not declared as a property, so parentheses are used. In fact, if we try to@property
-ize it, tests fail. This hints at fixing the documentation vs fixing the code, so the purpose of the ticket is to ask the question and help provide a definitive answer. Once the intention is clarified, I can provide the relevant patch.System Info
Linux 5.8.0-7642-generic x86_64
, according touname -sri
3.8.5
1.0.0