Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python time asctime() Function


previous next AddThis Social Bookmark Button


Description:

This function converts a tuple or struct_time representing a time as returned by gmtime() or localtime() to a 24-character string of the following form: 'Tue Feb 17 23:21:05 2009'.

Syntax:

time.asctime([t]))

Parameters:

Here is the detail of parameters:

  • A tuple of 9 elements or struct_time representing a time as returned by gmtime() or localtime() function.

Return Value:

This returns 24-character string of the following form: 'Tue Feb 17 23:21:05 2009'.

Example:

#!/usr/bin/python
import time

t = time.localtime()
print "time.asctime(t): %s " % time.asctime(t)

This produces following result at my machine:

time.asctime(t): Tue Feb 17 09:42:58 2009


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names