mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
add docstring about timestamp parsing
This commit is contained in:
parent
8283b353f4
commit
6d92784dbb
1 changed files with 5 additions and 0 deletions
|
@ -368,6 +368,11 @@ def parse_date(date: Any) -> Optional[datetime]:
|
||||||
|
|
||||||
if isinstance(date, str):
|
if isinstance(date, str):
|
||||||
if date.replace('.', '').isdigit():
|
if date.replace('.', '').isdigit():
|
||||||
|
# this is a brittle attempt at unix timestamp parsing (which is
|
||||||
|
# notoriously hard to do). It may lead to dates being off by
|
||||||
|
# anything from hours to decades, depending on which app, OS,
|
||||||
|
# and sytem time configuration was used for the original timestamp
|
||||||
|
# more info: https://github.com/pirate/ArchiveBox/issues/119
|
||||||
timestamp = float(date)
|
timestamp = float(date)
|
||||||
|
|
||||||
EARLIEST_POSSIBLE = 473403600.0 # 1985
|
EARLIEST_POSSIBLE = 473403600.0 # 1985
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue