YouTip LogoYouTip

Att Time Time

Python time time() Method | Tutorial

Tutorial -- Learning not just technology, but dreams!

Python Basic Tutorial

Python Basic Tutorial Python Introduction Python Environment Setup Python Chinese Encoding Python VS Code Python Basic Syntax Python Variable Types Python Operators Python Conditional Statements Python Loops Python While Loop Python for Loop Python Nested Loops Python break Statement Python continue Statement Python pass Statement Python Number Python Strings Python List Python Tuple Python Dictionary Python Date and Time Python Functions Python Modules Python File I/O Python File Methods Python Exceptions Python OS File/Directory Methods Python Built-in Functions

Python Advanced Tutorial

Python OOP Python Regular Expressions Python CGI Programming Python MySQL Python Network Programming Python SMTP Python Multithreading Python XML Parsing Python GUI Programming (Tkinter) Python 2.x vs 3.x Python IDE Python JSON Python AI Drawing Python 100 Examples Python Quiz

Python time strptime() Method

Python time tzset() Method

Deep Dive

  • Scripting Languages
  • Web Services
  • Software
  • Programming Languages
  • Programming
  • Computer Science
  • Web Service
  • Scripting
  • Development Tools
  • Web Design & Development

Python2.x Python time time() Method


Description

Python time time() returns the current time as a floating-point number of seconds since the epoch (1970-01-01 00:00:00 UTC).

Syntax

Syntax for the time() method:

time.time()

Parameters

  • NA.

Return Value

Returns the current time as a floating-point number of seconds since the epoch (1970-01-01 00:00:00 UTC).

Example

The following example demonstrates the usage of the time() function:

#!/usr/bin/python
import time

print "time.time(): %f " % time.time()
print time.localtime( time.time() )
print time.asctime( time.localtime(time.time()) )

The output of the above example is:

time.time(): 1234892919.655932
(2009, 2, 17, 10, 48, 39, 1, 48, 0)
Tue Feb 17 10:48:39 2009

← Att Time TzsetAtt Time Strptime β†’