On this page
  1. time.localtime
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

time.localtime

Prev: time.gmtime | Up: time | Next: time.mktime
Rel: time.asctime, time.clock_getres, time.clock_gettime, time.clock_gettime_ns
Ref: docs.python.org — time.localtime
Tags: #public #python3 #stdlib #time


Import

import time
from time import localtime

Signature & Overview

time.localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,

tm_sec,tm_wday,tm_yday,tm_isdst) Convert seconds since the Epoch to a time tuple expressing local time.

Usage

import time

tm = time.localtime()
assert isinstance(tm, time.struct_time) and tm.tm_year >= 2020

Gotchas

REPL Inspect

from time import localtime
help(localtime)

Linked from

Related notes