Att Time Localtime
# Python2.x Python time localtime() Method
* * *
## Description
The Python time localtime() function is similar to gmtime(), and its purpose is to format a timestamp into local time. If the sec parameter is not provided, the current time is used as the conversion standard. The DST (Daylight Savings Time) flag (-1, 0, or 1) indicates whether it is daylight saving time.
## Syntax
The syntax for the localtime() method is:
time.localtime()
## Parameters
* sec -- The number of seconds to convert into a time.struct_time object.
## Return Value
This function does not return any value.
## Example
The following example demonstrates the usage of the localtime() function:
## Example
#!/usr/bin/python import time print"time.localtime() : %s" % time.localtime()
The output of the above example is:
time.localtime() : time.struct_time(tm_year=2016, tm_mon=11, tm_mday=27, tm_hour=10, tm_min=26, tm_sec=5, tm_wday=6, tm_yday=332, tm_isdst=0)
YouTip