diff options
| -rw-r--r-- | library.py | 4 | 
1 files changed, 3 insertions, 1 deletions
| @@ -33,9 +33,11 @@ def get_raw_forecast(grid_id, grid_x, grid_y): | |||
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | def get_current_rounded_time(): | 35 | def get_current_rounded_time(): | 
| 36 | # Gets current time rounded down to the hour | ||
| 37 | |||
| 36 | tz = pytz.timezone("America/New_York") #temp | 38 | tz = pytz.timezone("America/New_York") #temp | 
| 37 | cur_time = datetime.datetime.now(tz=tz) | 39 | cur_time = datetime.datetime.now(tz=tz) | 
| 38 | cur_time_rounded = cur_time.replace(second=0, microsecond=0, minute=0, hour=cur_time.hour) + datetime.timedelta(hours=cur_time.minute//30) | 40 | cur_time_rounded = cur_time.replace(second=0, microsecond=0, minute=0, hour=cur_time.hour) | 
| 39 | return cur_time_rounded | 41 | return cur_time_rounded | 
| 40 | 42 | ||
| 41 | 43 | ||
