zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
U
«ý°d­ã@s>dZddlmZddlmZmZd dd„Zdd„Zd    d
„ZdS) zs
This module offers general convenience and utility functions for dealing with
datetimes.
 
.. versionadded:: 2.7.0
é)Úunicode_literals)ÚdatetimeÚtimeNcCs"t |¡}t | ¡td|d¡S)a
    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.
    r©Útzinfo)rÚnowÚcombineÚdater)rÚdt©r úEd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\dateutil/utils.pyÚtoday s
r cCs|jdk    r|S|j|dSdS)a¤
    Sets the ``tzinfo`` parameter on naive datetimes only
 
    This is useful for example when you are provided a datetime that may have
    either an implicit or explicit time zone, such as when parsing a time zone
    string.
 
    .. doctest::
 
        >>> from dateutil.tz import tzoffset
        >>> from dateutil.parser import parse
        >>> from dateutil.utils import default_tzinfo
        >>> dflt_tz = tzoffset("EST", -18000)
        >>> print(default_tzinfo(parse('2014-01-01 12:30 UTC'), dflt_tz))
        2014-01-01 12:30:00+00:00
        >>> print(default_tzinfo(parse('2014-01-01 12:30'), dflt_tz))
        2014-01-01 12:30:00-05:00
 
    :param dt:
        The datetime on which to replace the time zone
 
    :param tzinfo:
        The :py:class:`datetime.tzinfo` subclass instance to assign to
        ``dt`` if (and only if) it is naive.
 
    :return:
        Returns an aware :py:class:`datetime.datetime`.
    Nr)rÚreplace)r
rr r r Údefault_tzinfos
rcCs*t|ƒ}||}| |ko$|kSS)zn
    Useful for comparing two datetimes that may have a negligible difference
    to be considered equal.
    )Úabs)Zdt1Zdt2ÚdeltaÚ
differencer r r Ú within_delta@sr)N)Ú__doc__Ú
__future__rrrr rrr r r r Ú<module>s
 
#