real hour in python 1

real hour in python

import datetime
now =
print(now.year, now.month,, now.hour, now.minute, now.second)
# 2015 5 6 8 53 40

Here is what the above code is Doing:
1. We import the datetime module.
2. We create a variable named now and set it equal to
3. We print the year, month, day, hour, minute, and second of now to the console.

Similar Posts