arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.64k stars 667 forks source link

Updated to latest, string unix timestamp is not understood by 'get' #1117

Open sebtrack opened 2 years ago

sebtrack commented 2 years ago

Issue Description

import arrow

arrow.get('1657831049')

results in

arrow.parser.ParserError: Could not match input '1657831049' to any of the following formats: YYYY-MM-DD, YYYY-M-DD, YYYY-M-D, YYYY/MM/DD, YYYY/M/DD, YYYY/M/D, YYYY.MM.DD, YYYY.M.DD, YYYY.M.D, YYYYMMDD, YYYY-DDDD, YYYYDDDD, YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W.

worked beforehand but with the latest version it does not.

We would like to accept a lot of time formats and some of them are strings some of them are unix timestamps, so forcing a int/float conversion is unacceptable. It would be nice to use string unix timestamps.

System Info

anishnya commented 1 year ago

@krisfremen @systemcatch @jadchaar any insight on this?

13MK3 commented 1 year ago

From reading the release history, this behavior was intentionally changed in version 0.15.0 "to support the ISO 8601 basic format and to address bugs such as #447". Is this really something that people would want to revert?

anishnya commented 1 year ago

@krisfremen @jadchaar @systemcatch could you elaborate more for @13MK3