title: How do I find the next 7am in a timezone
body: <pre><code>current_datetime = datetime.now(tz)
  next_hour = datetime(current_datetime.year, current_datetime.month, current_datetime.day, 7, 0, 0, 0, tz)
  timedelta_until_next_hour = next_hour - current_datetime
  if timedelta_until_next_hour.total_seconds() &lt; 0:
      timedelta_until_next_hour += timedelta(days=1)
  return timedelta_until_next_hour.total_seconds()
  </code></pre>
  
  <p>I'm trying to find the next time it's 7am for a local timezone and return the number of seconds until that.</p>
  
  <p>I'm having some daylight savings time issues. For Example:  <code>America/New_York</code> <code>current_datetime</code> has a utcoffset of -4 hours
  Whereas <code>next_hour</code> has an offset of -5 hours, so the subtraction of the two is off by an hour</p>