Created
August 9, 2013 19:08
-
-
Save asmedrano/6196275 to your computer and use it in GitHub Desktop.
What hour of the year is it?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
now = datetime.now() | |
day_of_year = now.timetuple().tm_yday | |
current_hour_of_day = now.timetuple().tm_hour | |
hour_of_year = day_of_year * 24 - 24 + current_hour_of_day | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment