Difference between revisions of "JavaScript Date Object"

From Techotopia
Jump to: navigation, search
Line 2: Line 2:
  
 
The Date object enables the JavaScript develper to create a Date object set to a specific time and date, or to create a date object that reflects the current time on the computer on which the browser is running. There are two important things to note when working with the Date oject. Firstly,  when reading the date and time of the user's computer you are dependent on the user having set the correct day and time. Secondly, whilst you can read the date and time set on the user's computer, and change those settings within your Data object instance, you ''cannot'' change the date and time on the user's computer.
 
The Date object enables the JavaScript develper to create a Date object set to a specific time and date, or to create a date object that reflects the current time on the computer on which the browser is running. There are two important things to note when working with the Date oject. Firstly,  when reading the date and time of the user's computer you are dependent on the user having set the correct day and time. Secondly, whilst you can read the date and time set on the user's computer, and change those settings within your Data object instance, you ''cannot'' change the date and time on the user's computer.
 +
 +
== Creating a Date Object ==

Revision as of 19:57, 1 May 2007

The JavaScript Date object enables you to work with, and manipluate time (and no, it doesn't enable you to travel back through time to buy a lottery ticket with this week's winning numbers).

The Date object enables the JavaScript develper to create a Date object set to a specific time and date, or to create a date object that reflects the current time on the computer on which the browser is running. There are two important things to note when working with the Date oject. Firstly, when reading the date and time of the user's computer you are dependent on the user having set the correct day and time. Secondly, whilst you can read the date and time set on the user's computer, and change those settings within your Data object instance, you cannot change the date and time on the user's computer.

Creating a Date Object