The fields are y m d h m s, plus microseconds.
"A datetime object is a single object containing all the information from a date object and a time object. Like a date object, datetime assumes the current Gregorian calendar extended in both directions; like a time object, datetime assumes there are exactly 3600*24 seconds in every day."
What time is it now?
The format returned by
print
generally follows the ISO-8601 format, except for the microseconds, which I don't find in the wikipedia entry describing ISO-8601.The method
strftime()
takes a large number of format codes to control its behavior.Another useful object is the timedelta.
"A timedelta object represents a duration, the difference between two dates or times."
One of the issues that always comes up is time zones. Time zones are complicated, because their behavior is variable and needs to be specified. So we need yet another class object to deal with them. I'll look at that another time.