Please enable JavaScript.
Coggle requires JavaScript to display documents.
datetime - Coggle Diagram
datetime
datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
datetime.now(tz=None)
datetime.utcnow()
datetime.fromtimestamp(timestamp, tz=None)
datetime.fromisoformat(date_str)
:warning: Does not support parsing arbitrary ISO 8601 string. It is only intended as the inverse operation of datetime.isoformat()
dateutil.parser.isoparse – a more full-featured ISO 8601 parser
datetime.strptime(date_str, format)
datetime.replace(year=..., month=..., day=..., hour=..., minute=..., second=..., microsecond=..., tzinfo=..., *, fold=0)
tzinfo=None can be specified to create a naive datetime from an aware datetime with no conversion of date and time data
datetime.astimezone(tz=None)
If tz=None the system local timezone is assumed for the target timezone
datetime.timestamp()
:warning: For naive datetimes it relies on the mktime() therefore it may raise OverflowError
datetime.isoformat(sep='T', timespec='auto')
datetime.strftime(format)
timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)
timedelta.total_seconds()
Naive
datetime – without tz
Naive
datetime objects are treated as local times
Aware
datetime – with tz
:warning: Its preferred to use
aware
datetimes to represent times in UTC
timezone.utc