You might have encountered this issue many times while using datetimepicker on your modules.
For example, Datetimepicker is provideing you some other format of date and you want to display in some other format
or you want to add date, month or year to original date.
For example, if you are making alert of current date like below code then for date and month, you will get correct data
but for year you will wrong data.
so this you will be doing like this
For today alert you will get
var today =new Date(); alert(today); alert(today.getMonth()); alert(today.getYear());
Mon Feb 07 2011 11:52:21 GMT+0530 (India Standard Time)
For today.getMonth() alert, you will get,
For today.getYear() alert you will get,
which is wrong, that should alert 2011,
This is because getYear method returns the year minus 1900,
Solution to this,
this is give you current year as 2011
This issue mostly has been seen in Mozila browser.
Hope this post will help you,
if yes please put comment below of this page,
Senior Asp.Net Developer
e-Procurement Technologies Ltd (India)