Return a string representing the date and time:

>>> from datetime import datetime
>>> datetime(2002, 12, 4, 20, 30, 40).ctime()
'Wed Dec  4 20:30:40 2002'

The output string will not include time zone information, regardless of whether the input is aware or naive.

d.ctime() is equivalent to:


on platforms where the native C ctime() function (which time.ctime() invokes, but which datetime.ctime() does not invoke) conforms to the C standard.

Related Reading

datetime — Basic date and time types