task_script_utils.datetime_parser.ts_datetime module#
- class TSDatetime(datetime_: datetime, subseconds: str | None = None)[source]#
Bases:
objectTSDatetime wraps the parsed datetime and subsecond values and provide formatting functions like tsformat and isoformat
- property subseconds: str | None#
Subseconds represent fractional part of seconds value that was parsed from raw datetime as string. eg: In 05-26-1991 12:12:23.000000023, 000000023 as string would represent subseconds. Subseconds is None when it is not present in raw datetime string
- property tzinfo: tzinfo#
Returns tzinfo for the stored datetime object
- property datetime: datetime#
Return a new datetime object after replacing microseconds with self._subseconds in self._datetime. subseconds needs to be truncated to 6 digits