Python time asctime() method
Description
The Python time asctime() function accepts a time tuple and returns a readable 24-character string in the form "Tue Dec 11 18:07:14 2008" (Tuesday, December 11, 2008, 18:07:14).
Syntax
asctime() method syntax:
time.asctime([t]))
Parameters
- t -- a 9-element tuple or the time value returned by the gmtime() or localtime() function.
Return Value
Returns a readable 24-character string in the form "Tue Dec 11 18:07:14 2008" (Tuesday, December 11, 2008, 18:07:14).
Example
The following example shows how to use the asctime() function:
#!/usr/bin/python
import time
t = time.localtime()
print "time.asctime(t): %s " % time.asctime(t)
The output of the above example is:
time.asctime(t): Tue Feb 17 09:42:58 2009