Conditions | 1 |
Total Lines | 11 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from datetime import date |
||
5 | def default_date_serializer(obj: date, **kwargs) -> str: |
||
6 | """ |
||
7 | Serialize the given date instance to a string. It uses the RFC3339 |
||
8 | pattern. If date is a localtime, an offset is provided. If date is |
||
9 | in UTC, the result is suffixed with a 'Z'. |
||
10 | :param obj: the date instance that is to be serialized. |
||
11 | :param kwargs: not used. |
||
12 | :return: ``date`` as an RFC3339 string. |
||
13 | """ |
||
14 | return to_str(obj, False, kwargs['fork_inst'], |
||
15 | RFC3339_DATE_PATTERN) |
||
16 |