Open In App

Python time.tzname() Function

Last Updated : 22 Nov, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

Time tzname() in Python returns the tuple of two strings in which the first string is the name of the local non-DST timezone and the second string is the name of the local DST timezone. 

Syntax: time.tzname()

Return: It will return the tuple of strings

Example 1: Python program to get the DST and non DST

Python3
# import time module
import time

# get the DST
print(time.tzname)

Output:

('UTC', 'UTC')

Example 2: Use the index numbers to get the strings

Python3
# import time module
import time

# get the DST of first string
print(time.tzname[0])

# get the DST of second string
print(time.tzname[1])

Output:

UTC
UTC

Article Tags :
Practice Tags :

Similar Reads

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy