Overview:
- The method tzname() returns the name of the time zone given during the construction of the timezone object.
- Class timezone only acts as a container of two vital pieces of information pretaining to a time zone:
- UTC Offset as a timedelta
- Name of the time zone as a string - Developer gives this name to identify a time zone for later processing.
Example:
- Unless specifically stated that the created time zone denotes the "Chile Time" through the name parameter of the timezone constructor, -4.00 hours could generally mean Atlantic Standard Time or Amazon Time as well. The Developer can use this string elsewhere while processing the time.
# Example Python program that returns # Create a time duration of -4:00 hours |
Output:
Date and Time:2021-01-01 00:00:00-04:00 UTC Offset:-14400.0 Time zone:Chile Time |