Hi there,

I was trying to deal with the script in my application, it should display
how many weeks left...

Say: for instance, I set 1st May 2010 in my application and it should
compare the local time.

The following code seems doesn't work correctly, am I missing something?
would you mind to have a look?

Thank you

------------------------------------------------------

oneDay = 1000*60*60*24;
oneWeek = oneDay * 7;

localDate = new Date();
targetDate = new Date ( 2010 , 5 , 1 );


date1Ms=targetDate.getTime();
date2Ms=localDate.getTime();

differenceMs = date1Ms - date2Ms;

weeks = ( differenceMs/oneWeek );

--------------------------------------------------------
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to