DateObj is a valid Date object created using Date() constructor in which we want to set the millisecond. Value of millisecond is from 0 to 999.
Parameter: Here parameter is milliseconds_Value i.e, the value of millisecond which is used to set in date() constructor.
Return Values: It returns the new i.e updated millisecond which is set by setMilliseconds() function.
Errors and Exceptions
> 42 > 4 > 1 > 2018
Here 42 is the new milliseconds, 4 is the current month i.e April, 1 is the current date and 2018 is the current year.
> 6 > 33
Here 6 is the new millisecond and second becomes 33 from 32 because millisecond range is form 0 to 999 i.e, total 1000 and we set new millisecond as 1006 which increase second by one to 33 from 32 and millisecond becomes 6.
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.