Python Datetime Module
Date and time handling — date, datetime, timedelta, timezone. This category documents 12 Python datetime module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: datetime.date(), datetime.date.today(), datetime.datetime.now(), datetime.datetime.utcnow(), datetime.datetime.fromtimestamp(), datetime.datetime.strptime(), datetime.datetime.strftime(), datetime.timedelta(), datetime.timezone.utc, datetime.date.weekday(), datetime.date.isoformat(), datetime.datetime.isoformat(). datetime.date() creates a date object representing a specific date (year, month, day). datetime.date.today() returns the current local date. datetime.datetime.now() returns the current local date and time with optional timezone. datetime.datetime.utcnow() returns the current UTC date and time (deprecated, use now(timezone.utc)). datetime.datetime.fromtimestamp() converts a Unix timestamp to a datetime object. For a structured walkthrough of the whole topic, read the Datetime Module guide. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground.