Python 3 - time altzone() Method


Advertisements

Description

The method altzone() is the attribute of the time module. This returns the offset of the local DST timezone, in seconds west of UTC, if one is defined. This is negative if the local DST timezone is east of UTC (as in Western Europe, including the UK). Only use this if daylight is nonzero.

Syntax

Following is the syntax for altzone() method −

time.altzone

Parameters

NA

Return Value

This method returns the offset of the local DST timezone, in seconds west of UTC, if one is defined.

Example

The following example shows the usage of altzone() method.

#!/usr/bin/python3
import time

print ("time.altzone : ", time.altzone)

Result

When we run the above program, it produces the following result −

time.altzone :  -23400
python_date_time.htm
Advertisements