HTML | DOM Input DatetimeLocal stepUp() Method

The Input DatetimeLocal stepUp() method in HTML DOM is used to increment the value of the Local datetime field by a specified number. The Input DatetimeLocal stepUp() method can only be used on the value Minutes. Years, months, days, hours, seconds or milliseconds are not affected by the stepUp() method.


datetimelocalObject.stepUp( number )

Parameters: This method accepts single parameter number which is used to specify the amount of minutes the local datetime field should increase.

Below program illustrates the DatetimeLocal stepUp property in HTML DOM:

Example: This example use stepUp() method to increment the value of minutes by 2.





<!DOCTYPE html>
        Input DatetimeLocal stepUp() Method
<body style="text-align:center;">
    <h1 style="color:green;">
    <h2 style="font-family: Impact;"
        Input DatetimeLocal stepUp() Method
    <input type="datetime-local" id="test_DatetimeLocal">
        To increase the value of the datetimeLocal field
        by 2minutes, double click the "Update" button.
    <button ondblclick="My_DatetimeLocal()">
    <!-- Script to use stepUp() method -->
        function My_DatetimeLocal() {


Before clicking on the button:

After clicking on the button:

Supported Browsers: The browser supported by Input DatetimeLocal stepUp() method are listed below:

  • Apple Safari
  • Internet Explorer 12.0
  • Google Chrome
  • Opera


My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.