Saturday, 9 December 2017

date - How to get on python current time?

I need to have the date.
The format of the time
should be 2017-01-18T07:34:35Z
I have tried this but
it does not work:



import
datetime
i = datetime.datetime.now()

date = %i.year "-"
%i.month "-" %i.day "T" %i.hour ":" %i.minute ":" %i.second
"Z"

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...