Quick Answer
datetime module: datetime.datetime for date+time, date for date-only, time for time-only, timedelta for durations. strftime(format) converts datetime to string. strptime(string, format) parses string to datetime. Use timezone-aware datetimes: datetime.now(timezone.utc). Python 3.9+ has zoneinfo for IANA timezone support. dateutil library simplifies parsing and timezone handling.
Answer
datetime provides date/time objects and timedelta. time handles timestamps and sleep. Supports formatting and parsing with strptime().
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.