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:
@ -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
|
||||
|
@ -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())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user