JavaScript Date.UTC()
JavaScript Date.UTC()
The Date.UTC() method is used to return the number of milliseconds between a specific date and January 1, 1970, according to UTC. UTC is basically Universal Coordinated Time and is the same as GMT time. It is a static method of the Date object.
Syntax:-
Its syntax is:- Date.UTC(year, month, day, hours, minutes, seconds, milliseconds)
Return:-
Its return is:- number of milliseconds between a specific date and January 1, 1970
Further Explanation:-
Parameter | Description |
---|---|
year | Required. A four-digit value represents the year. |
month | Required. An integer representing the month from 0 - 11. |
day | Optional. An integer representing the day of the month from 1 - 31. |
hours | Optional. Default is 0. An integer representing the hour from 0 - 23. |
minutes | Optional. Default is 0. An integer representing the minutes from 0 - 59. |
seconds | Optional. Default is 0. An integer representing the seconds from 0 - 59. |
milliseconds | Optional. Default is 0. An integer representing the milliseconds from 0 - 999. |