1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

add microsecond field

This commit is contained in:
Kelly Brazil
2022-07-21 10:16:58 -07:00
parent 7389ed5d0c
commit 163a76dd10
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@ Schema:
"hour_24": integer, "hour_24": integer,
"minute": integer, "minute": integer,
"second": integer, "second": integer,
"microsecond": integer,
"period": string, "period": string,
"utc_offset": string, "utc_offset": string,
"day_of_year": integer, "day_of_year": integer,
@ -55,6 +56,7 @@ Examples:
"hour_24": 14, "hour_24": 14,
"minute": 52, "minute": 52,
"second": 45, "second": 45,
"microsecond": 0,
"period": "PM", "period": "PM",
"utc_offset": "+0000", "utc_offset": "+0000",
"day_of_year": 201, "day_of_year": 201,

View File

@ -26,6 +26,7 @@ Schema:
"hour_24": integer, "hour_24": integer,
"minute": integer, "minute": integer,
"second": integer, "second": integer,
"microsecond": integer,
"period": string, "period": string,
"utc_offset": string, "utc_offset": string,
"day_of_year": integer, "day_of_year": integer,
@ -50,6 +51,7 @@ Examples:
"hour_24": 14, "hour_24": 14,
"minute": 52, "minute": 52,
"second": 45, "second": 45,
"microsecond": 0,
"period": "PM", "period": "PM",
"utc_offset": "+0000", "utc_offset": "+0000",
"day_of_year": 201, "day_of_year": 201,
@ -299,6 +301,7 @@ def parse(data, raw=False, quiet=False):
'hour_24': dt.hour, 'hour_24': dt.hour,
'minute': dt.minute, 'minute': dt.minute,
'second': dt.second, 'second': dt.second,
'microsecond': dt.microsecond,
'period': dt.strftime('%p').upper(), 'period': dt.strftime('%p').upper(),
'utc_offset': dt.strftime('%z') or None, 'utc_offset': dt.strftime('%z') or None,
'day_of_year': int(dt.strftime('%j')), 'day_of_year': int(dt.strftime('%j')),