|
Javascript: Date and Time |
|
|
|
|
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); The table below shows instead the most important Date class methods: | Method | Description | | 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 )
|