Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 7
    @Chacha102: You don't need two Date objects. var d = new Date(); d.setMinutes(d.getMinutes() + 30); Commented Jul 29, 2009 at 21:29
  • 15
    He wanted two date objects. Read the Question. One Date object which is 30 minutes ahead of another date object. Commented Jul 29, 2009 at 21:38
  • 5
    Does this work ok if it loops past the hour? So if I call it at 11:59, does it schedule ok at 12:29?
    – Chris Rae
    Commented Sep 20, 2017 at 23:18
  • 3
    @ChrisRae yes, it does. If a parameter you specify is outside of the expected range, setMinutes() attempts to update the date information in the Date object accordingly.
    – frido
    Commented Mar 26, 2019 at 14:19