1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-10-08 23:22:21 +02:00

add calculated timestamp

This commit is contained in:
Kelly Brazil
2022-04-20 09:44:42 -04:00
parent 477329ce5b
commit b53e42aca6
5 changed files with 29 additions and 6 deletions

View File

@@ -16,6 +16,12 @@ Additional options supported:
- `--stat`
- `--shortstat`
The `epoch` calculated timestamp field is naive. (i.e. based on the
local time of the system the parser is run on)
The `epoch_utc` calculated timestamp field is timezone-aware and is
only available if the timezone field is UTC.
Usage (cli):
$ git log | jc --git-log
@@ -37,6 +43,8 @@ Schema:
"author": string,
"author_email": string,
"date": string,
"epoch": integer,
"epoch_utc": integer,
"commit_by": string,
"commit_by_email": string,
"commit_by_date": string,

View File

@@ -187,7 +187,7 @@ class timestamp()
```python
def __init__(datetime_string: str,
format_hint: Union[List, Tuple, None] = None) -> None
format_hint: Optional[Iterable] = None) -> None
```
Input a datetime text string of several formats and convert to a
@@ -198,7 +198,7 @@ Parameters:
datetime_string (str): a string representation of a
datetime in several supported formats
format_hint (list | tuple): an optional list of format ID
format_hint (iterable): an optional iterable of format ID
integers to instruct the timestamp object to try those
formats first in the order given. Other formats will be
tried after the format hint list is exhausted. This can