Timeline for How to add 30 minutes to a JavaScript Date object?
Current License: CC BY-SA 2.5
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 21, 2020 at 3:07 | history | rollback | GirkovArpa |
Rollback to Revision 1
|
|
S Feb 25, 2020 at 11:49 | history | suggested | heyt0pe | CC BY-SA 4.0 |
improved formatting, variable declaration consistency, error fix
|
Feb 25, 2020 at 11:16 | review | Suggested edits | |||
S Feb 25, 2020 at 11:49 | |||||
Dec 30, 2014 at 6:34 | comment | added | Mihai Crăiță | @trevorgrayson If a parameter you specify is outside of the expected range, setMinutes() attempts to update the date information accordingly. For example, if you use 100, the hours will be incremented by 1 and 40 will be used for minutes. | |
Sep 17, 2014 at 17:18 | comment | added | Kip | FYI- this can break across Daylight Saving Time boundaries. JSFiddle demos: "spring forward" / "fall back" (Thanks @Spig for this) | |
Feb 15, 2012 at 5:19 | comment | added | s29 | @CKeene, setMinutes & getMinutes are part of plain old Javascript (though datejs does provide a whole bunch of other stuff). | |
Jul 30, 2009 at 17:53 | comment | added | Jamie | @Grant: I assumed d2 = "I'd like to get a Date object" and d1 = "to another Date object" | |
Jul 29, 2009 at 21:28 | comment | added | Grant Wagner |
@Jamie: You don't need two Date objects. var d = new Date(); d.setMinutes(d.getMinutes() + 30);
|
|
Jul 29, 2009 at 3:40 | history | answered | Jamie | CC BY-SA 2.5 |