Click to See Complete Forum and Search --> : Simple new Date() question


Muncho
10-01-2003, 09:33 AM
Hi all.

Just started working through the javascript primers and was wondering what the reason was for having to create your own object when using the Date() methods.

Is there a logical reason why a pre defined date object isn't present in the language?

Not a really important life or death question, but interested in finding out why, that's all. :)

Thanks.

requestcode
10-01-2003, 09:41 AM
By storing it in a variable you can then manipulate the date. It will allow you to format the date a certain way. Some people prefer mm/dd/yy or mm/dd/yyyy or yyyymmdd, etc. You can also then grab the time in seconds, minutes and hours at the clients PC and again manipulate that. I am sure there are a lot of other reasons.