Skip to content

Commit

Permalink
Merge pull request #14 from openclimatefix/issue/round-dt
Browse files Browse the repository at this point in the history
round timestamp down to 15 mins #13
  • Loading branch information
peterdudfield authored Feb 9, 2024
2 parents ad23fd9 + bb67774 commit 96d7c13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion india_forecast_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def app(timestamp: dt.datetime | None, write_to_db: bool, log_level: str):
logging.basicConfig(stream=sys.stdout, level=getattr(logging, log_level.upper()))

if timestamp is None:
timestamp = dt.datetime.now(tz=dt.UTC)
# get the timestamp now rounded down the neartes 15 minutes
timestamp = pd.Timestamp.now(tz="UTC").floor("15min")
log.info('Timestamp omitted - will generate forecasts for "now"')
else:
# Ensure timestamp is UTC
Expand Down

0 comments on commit 96d7c13

Please sign in to comment.