hello all,
we are working for a countdown in flash for one of our website ( http://www.pallibatani.com )
in such a way that the target time always stays at the offset 300 and will never go to the others even when we change our timezones
the following is the code we are using
var today:Date = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();
//Now, here is where you can set the countdown date.
//The format for dates in flash are: Year, Month (0-11, 0 being January), Day.
//To countdown to the current year, use 'CurrentYear' or for a specific year, use '2011', '2012' etc.
var targetDate:Date = new Date(currentYear,04,21);
var timezone = trace(today.getTimezoneOffset());
if( timezone = "300")
{
var targetTime = targetDate.getTime()+43200000;
}
else if(timezone = "240")
{
var targetTime = targetDate.getTime()+46800000;
}
else
{
var targetTime = targetDate.getTime()+39600000;
}