JavaScript Date and Time Functions

 

 

The JavaScript support various type of date and time functions which helps to perform the date and time related task in the application.

 

Function Description
getdate()   Returns the day of the month. 
getUTCDate()   Returns the day of the month. 
getFullYear()  Returns Year (with 4 digits). 
getUTCFullYear()  Returns Year (with 4 digits).  
getHours()  Returns Hour of the day in integer. 
getUTCHours()   Returns Hour of the day in integer. 
getMilliseconds()   Returns Milliseconds.  
getUTCMilliseconds()   Returns Milliseconds.
getSeconds()   Returns Seconds.  
getUTCSeconds()   Returns Seconds. 
getMonth()   Returns Month. 
getUTCMonth()   Returns Month. 
getMinutes()   Returns Minutes.  
getUTCMinutes()   Returns Minutes. 
UTC()   Returns Date in milliseconds. 
valueOf()   Returns Date in milliseconds.
setTime()   Returns Date in milliseconds.
setYear()   Returns Date in milliseconds. 
setSeconds()   Returns Date in milliseconds.  
setUTCSeconds()  Returns Date in milliseconds. 
setFullYear()   Returns Date in milliseconds.  
setUTCFullYear()   Returns Date in milliseconds.   
parse()   Returns the number of milliseconds.  
getTime() Returns the number of milliseconds.
getTimezoneOffset()   Returns the difference of Time Zone.
getYear()   Returns Year. 
setdate()   Returns Date in milliseconds.
setUTCDate()   Returns Date in milliseconds.
setHours()   Returns  Date in milliseconds.
setUTCHours() Returns Date in milliseconds.
setMinutes()   Returns Date in milliseconds.
setUTCMinutes()   Returns Date in milliseconds.
setMonth()   Returns Date in milliseconds.
setUTCMonth()   Returns Date in milliseconds.
toLocaleString() Returns date and time in String.  
toString()   Returns date and time in String.   
toGMTString()   Returns GMT date and time in String. 
toUTCString()   Returns GMT date and time in String.  
setMilliseconds() Sets the milliseconds. 
setUTCMilliseconds() Sets the milliseconds.