Returns a :py:class:`datetime` representing the current day at midnight :param tzinfo: The time zone to attach (also used to determine the current day). :return: A :py:class:`datetime.datetime` object representing the current day at midnight.
(tzinfo=None)
| 9 | |
| 10 | |
| 11 | def today(tzinfo=None): |
| 12 | """ |
| 13 | Returns a :py:class:`datetime` representing the current day at midnight |
| 14 | |
| 15 | :param tzinfo: |
| 16 | The time zone to attach (also used to determine the current day). |
| 17 | |
| 18 | :return: |
| 19 | A :py:class:`datetime.datetime` object representing the current day |
| 20 | at midnight. |
| 21 | """ |
| 22 | |
| 23 | dt = datetime.now(tzinfo) |
| 24 | return datetime.combine(dt.date(), time(0, tzinfo=tzinfo)) |
| 25 | |
| 26 | |
| 27 | def default_tzinfo(dt, tzinfo): |
nothing calls this directly
no outgoing calls
no test coverage detected