spacer.png, 0 kB
spacer.png, 0 kB
Home arrow Javascript arrow Javascript: Date and Time
Javascript: Date and Time PDF Print E-mail
 
Date is the Javascript object for current date and time (performing also some operations on it). The code here below shows a date in the day/month/year format
var d = new Date();
var dt = (d.getDate() + "/" + (d.getMonth()+1)+ "/" + d.getFullYear());
document.write(dt);
Image
The table below shows instead the most important Date class methods:
MethodDescription
getDate()day of the month
getFullYear()Year (four digits)
getHours()Hours
getMinutes()Minutes
getMonth()Month (- 1)
getSeconds()Seconds
getTime()Unix Epoque value
toString()convert date to a string
toUString()convert date to a UTC string
Last Updated ( mercoledì, 28 novembre 2007 )
 
< Prev
spacer.png, 0 kB
spacer.png, 0 kB
spacer.png, 0 kB