JavaScript Reference/Javascript Methods/UTC

Материал из Web эксперт
Перейти к: навигация, поиск

"UTC()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="var myDate = new Date(); alert(Date.UTC(myDate));"> UTC </button> </body> </html>


     </source>
   
  


"UTC()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |Date | +----------------+--------------------------------------------------------------+

     </source>
   
  


"UTC()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Uses UTC time to get the milliseconds elapsed between January 1, 1970 and the specified date.

Syntax:

dateName.UTC(param1, param2, param3, param4, param5, param6, param7) Parameters:

   param1   Required; the four-digit year.
   param2   Optional; the month. Value: 0 to 11.
   param3   Optional; the day of the month. Value: 1 to 31.
   param4   Optional; the hour. Value: 0 to 23.
   param5   Optional; the minutes. Value: 0 to 59.
   param6   Optional; the seconds. Value: 0 to 59.
   param7   Optional; the milliseconds elapsed during the current second. 
                      Value: 0 to 999. 
   
     
     </source>