Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/dateutil/__pycache__/utils.cpython-37.pyc

61 lines
2.2 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>[<5B>]<5D><00>@s>dZddlmZddlmZmZd dd<06>Zdd<08>Zd d
<EFBFBD>ZdS) zs
This module offers general convenience and utility functions for dealing with
datetimes.
.. versionadded:: 2.7.0
<EFBFBD>)<01>unicode_literals)<02>datetime<6D>timeNcCs"t<00>|<00>}t<00>|<01><03>td|d<02><02>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)<01>tzinfo)r<00>now<6F>combine<6E>dater)r<00>dt<64>r
<00>;/tmp/pip-install-u_6_z2pz/python-dateutil/dateutil/utils.py<70>today s
r cCs|jdk r|S|j|d<02>SdS)a<>
Sets the 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`.
N)r)r<00>replace)r rr
r
r <00>default_tzinfos
rcCs*t|<02>}||}| |ko$|kSS)zh
Useful for comparing two datetimes that may a negilible difference
to be considered equal.
)<01>abs)Zdt1Zdt2<74>delta<74>
differencer
r
r <00> within_delta@sr)N)<08>__doc__<5F>
__future__rrrr rrr
r
r
r <00><module>s
 
#