MCPcopy Create free account
hub / github.com/dateutil/dateutil / today

Function today

src/dateutil/utils.py:11–24  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

9
10
11def 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
27def default_tzinfo(dt, tzinfo):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected