Tuesday, September 10, 2019

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

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...