Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > javascript default date is one month off

Reply
Thread Tools

javascript default date is one month off

 
 
ahmedbm@gmail.com
Guest
Posts: n/a
 
      12-06-2005
I just noticed that all my javascript months are off by one
month.....didn't test multiple systems tho and my system date is fine.

Any way of fixing this?

TIA,
Ahmed

 
Reply With Quote
 
 
 
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      12-06-2005
writes:

> I just noticed that all my javascript months are off by one
> month.....didn't test multiple systems tho and my system date is fine.
>
> Any way of fixing this?


Most likely by realising that the results returned by Date's getMonth
is zero-based, i.e., 0 for January and 11 for December. Knowing that
instantly makes the results correct

/L
--
Lasse Reichstein Nielsen -
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
 
 
 
ahmedbm@gmail.com
Guest
Posts: n/a
 
      12-06-2005
lol, i guess that answers my question!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cal control - pre selecting a date from last month - and the calendar still shows this month. Mufasa ASP .Net 0 09-05-2008 06:51 PM
verifying a date is valid based on integer values for year, month and day of month lbrtchx@hotmail.com Java 1 12-22-2006 08:24 PM
[newbie] this month, the next month, and the one after that Mason Kessinger Ruby 16 01-20-2006 04:17 AM
MonthCalendar1 or DateTimePicker1 How to jump for one month or haw to get no of month? Michal Maciejczak C++ 1 04-23-2005 11:18 AM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57