Total Complexity | 1 |
Total Lines | 16 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from datetime import date |
||
2 | |||
3 | from jsons._datetime_impl import to_str, RFC3339_TIME_PATTERN |
||
4 | |||
5 | |||
6 | def default_time_serializer(obj: date, **kwargs) -> str: |
||
7 | """ |
||
8 | Serialize the given time instance to a string. It uses the RFC3339 |
||
9 | pattern. |
||
10 | :param obj: the time instance that is to be serialized. |
||
11 | :param kwargs: not used. |
||
12 | :return: ``time`` as an RFC3339 string. |
||
13 | """ |
||
14 | return to_str(obj, False, kwargs['fork_inst'], |
||
15 | RFC3339_TIME_PATTERN) |
||
16 |