Copyright © tutorialspoint.com

Python time asctime() Function

previous next


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:

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

Copyright © tutorialspoint.com