mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
add timestamp info
This commit is contained in:
@ -36,9 +36,11 @@ Schema:
|
|||||||
"day_of_year": integer,
|
"day_of_year": integer,
|
||||||
"week_of_year": integer,
|
"week_of_year": integer,
|
||||||
"iso": string,
|
"iso": string,
|
||||||
"timestamp": integer
|
"timestamp": integer # [0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[0] timezone aware UNIX timestamp expressed in UTC
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
|
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
|
||||||
|
@ -31,9 +31,11 @@ Schema:
|
|||||||
"day_of_year": integer,
|
"day_of_year": integer,
|
||||||
"week_of_year": integer,
|
"week_of_year": integer,
|
||||||
"iso": string,
|
"iso": string,
|
||||||
"timestamp": integer
|
"timestamp": integer # [0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[0] timezone aware UNIX timestamp expressed in UTC
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
|
$ 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')),
|
'day_of_year': int(dt.strftime('%j')),
|
||||||
'week_of_year': int(dt.strftime('%W')),
|
'week_of_year': int(dt.strftime('%W')),
|
||||||
'iso': dt.isoformat(),
|
'iso': dt.isoformat(),
|
||||||
# TODO: Check that timestamp is always based on UTC (aware)
|
|
||||||
'timestamp': int(dt.timestamp())
|
'timestamp': int(dt.timestamp())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user