Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Write a script that reads the current time and converts it to a time of day in hours, minutes, and
- seconds, plus the number of days since the epoch.
- """
- import time
- now = time.time()
- print(now)
- days = int(now // 86400)
- hours = int(now % 86400 // 3600)
- mins = int(now % 86400 % 3600 // 60)
- secs = int(now % 86400 % 3600 % 60)
- print('days={:d}, hours={:d}, minutes={:d}, seconds={:d}'.format(days,hours,mins,secs))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement