1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

add timestamp info

This commit is contained in:
Kelly Brazil
2022-07-20 23:02:16 -07:00
parent e27ed0743c
commit 2a11fefe45
2 changed files with 6 additions and 3 deletions

View File

@ -36,9 +36,11 @@ Schema:
"day_of_year": integer,
"week_of_year": integer,
"iso": string,
"timestamp": integer
"timestamp": integer # [0]
}
[0] timezone aware UNIX timestamp expressed in UTC
Examples:
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p

View File

@ -31,9 +31,11 @@ Schema:
"day_of_year": integer,
"week_of_year": integer,
"iso": string,
"timestamp": integer
"timestamp": integer # [0]
}
[0] timezone aware UNIX timestamp expressed in UTC
Examples:
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
@ -302,7 +304,6 @@ def parse(data, raw=False, quiet=False):
'day_of_year': int(dt.strftime('%j')),
'week_of_year': int(dt.strftime('%W')),
'iso': dt.isoformat(),
# TODO: Check that timestamp is always based on UTC (aware)
'timestamp': int(dt.timestamp())
}