python:handling_dates

Handling Dates

Convert datetime values to and from strings in ISO 8601 format

from datetime import datetime
import dateutil.parser
 
dt = datetime.now()
 
print(type(dt))
print(type(dt.isoformat()))
 
print(type(dateutil.parser.parse('2023-03-20T15:35:30Z')))
  • python/handling_dates.txt
  • Last modified: 2023/03/20 18:18
  • by mgupton