It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Java script issue for few timezones in october only

Java script issue for few timezones in october only

Postby PranavSharma on Tue Oct 18, 2011 3:32 pm

Hi Guys
Please help for below code. If time zone is GMT-3 (Brisilia) and current month is october then this code is hanging. you can check by simply putting this code in some html.

Please help in resolving and understanding this code. Due to this one of our crtical website users are facing lot of issues.

I can use timezone offset and make it independent of time zone, however reason is unclear why it has issues in first place in October in specific timezones.

Thanks
Pranav Sharma

**************************************************************************************************

<script type="text/javascript">
var nDate;
var nCurrentYear = 2011;
var nCurrentMonth = 10;
nYear=2011;
nMonth=10;
var date = new Date(nYear, nMonth-1, 1);

document.write('Month:'+date.getMonth() +':CurrentMonth:'+nCurrentMonth);
while (date.getMonth() == nCurrentMonth-1)
{
nDate = date.getDate();
//alert(' date String===== '+ date.toDateString() +" Date parameter::"+date.getDate()+1 );
document.write(date.toDateString());
date = new Date(nCurrentYear, date.getMonth(), date.getDate()+1);
}


</script>

*******************************************************************************
PranavSharma
 
Posts: 1
Joined: Tue Oct 18, 2011 3:22 pm

Who is online

Users browsing this forum: No registered users and 4 guests