# Help: Timezone Script

**URL:** <https://forum.kirupa.com/t/help-timezone-script/244304>\
**Category:** flash\
**Created:** [November 16, 2007, 4:15am UTC](https://forum.kirupa.com/t/help-timezone-script/244304 "2007-11-16T04:15:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxz74](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@maxz74](https://forum.kirupa.com/u/maxz74)\
**Post date:** [November 16, 2007, 4:15am UTC](https://forum.kirupa.com/t/help-timezone-script/244304/1 "2007-11-16T04:15:19Z")

</div>

Can anyone help me with this action script. The problem is the time for Mumbai ([www.mfgtrading.com](http://www.mfgtrader.com/)) when ever it hits 3am in singapore time the mumbai time reads as 001:00. It should be 00:00

Please help me… here is the code

Root Code 1st frame

```auto
attachMovie("DateAndTime", "myClip", 10);
myClip._x = 0;
MyClip._y = 0;
MyClip._visible = false;

```

Movie 1st frame code

```auto
mypDate = new Date();

```

Movie 2nd frame code

```auto
function amendHours(Hours)
{
    var _l1 = Hours;
    if (_l1 == 24)
    {
        _l1 = "0";
    } 
    // end if
    if (_l1 == 25)
    {
        _l1 = "1";
    } 
    // end if
    if (_l1 == 26)
    {
        _l1 = "2";
    } 
    // end if
    if (_l1 == 27)
    {
        _l1 = "3";
    } 
    // end if
    if (_l1 == 28)
    {
        _l1 = "4";
    } 
    // end if
    if (_l1 == 29)
    {
        _l1 = "5";
    } 
    // end if
    if (_l1 == 30)
    {
        _l1 = "6";
    } 
    // end if
    if (_l1 == 31)
    {
        _l1 = "7";
    } 
    // end if
    if (_l1 == 32)
    {
        _l1 = "8";
    } 
    // end if
    if (_l1 == 33)
    {
        _l1 = "9";
    } 
    // end if
    if (_l1 == 34)
    {
        _l1 = "10";
    } 
    // end if
    if (_l1 == 35)
    {
        _l1 = "11";
    } 
    // end if
    if (_l1 == 36)
    {
        _l1 = "12";
    } 
    // end if
    if (_l1 == 37)
    {
        _l1 = "13";
    } 
    // end if
    if (_l1 == 38)
    {
        _l1 = "14";
    } 
    // end if
    if (_l1 == 39)
    {
        _l1 = "15";
    } 
    // end if
    if (_l1 == 40)
    {
        _l1 = "16";
    } 
    // end if
    if (_l1 == 41)
    {
        _l1 = "17";
    } 
    // end if
    if (_l1 == 42)
    {
        _l1 = "18";
    } 
    // end if
    if (_l1 == 43)
    {
        _l1 = "19";
    } 
    // end if
    if (_l1 == 44)
    {
        _l1 = "20";
    } 
    // end if
    if (_l1 == 45)
    {
        _l1 = "21";
    } 
    // end if
    if (_l1 == 46)
    {
        _l1 = "22";
    } 
    // end if
    if (_l1 == 47)
    {
        _l1 = "23";
    } 
    // end if
    if (_l1 == 48)
    {
        _l1 = "24";
    } 
    // end if
    if (_l1 == -1)
    {
        _l1 = "23";
    } 
    // end if
    if (_l1 == -2)
    {
        _l1 = "22";
    } 
    // end if
    if (_l1 == -3)
    {
        _l1 = "21";
    } 
    // end if
    if (_l1 == -4)
    {
        _l1 = "20";
    } 
    // end if
    if (_l1 == -5)
    {
        _l1 = "19";
    } 
    // end if
    if (_l1 == -6)
    {
        _l1 = "18";
    } 
    // end if
    if (_l1 == -7)
    {
        _l1 = "17";
    } 
    // end if
    if (_l1 == -8)
    {
        _l1 = "16";
    } 
    // end if
    if (_l1 == -9)
    {
        _l1 = "15";
    } 
    // end if
    if (_l1 == -10)
    {
        _l1 = "14";this
    } 
    // end if
    return(_l1);
} 
// End of the function
si_seconds = mypdate.getUTCSeconds() < 10 ? ("0" + mypdate.getUTCSeconds()) : (mypdate.getUTCSeconds());
si_minutes = mypdate.getUTCMinutes() < 10 ? ("0" + mypdate.getUTCMinutes()) : (mypdate.getUTCMinutes());
si_hours = mypdate.getUTCHours();
si_month = mypdate.getUTCMonth();
si_year = mypdate.getUTCFullYear();
si_date = mypdate.getUTCDate();
var hongkongHours = amendHours(si_hours + 8);
var singaporeHours = amendHours(si_hours + 8);
var mumbaiHours = amendHours(si_hours + 5);
var dubaiHours = amendHours(si_hours + 4);
if (si_minutes < 30)
{
    mumbaiHours2 = mumbaiHours;
}
else
{
    mumbaiHours2 = mumbaiHours + 1;
} // end if
if (si_minutes == 0)
{
    mumbaiMinutes = "30";
}
else if (si_minutes == 1)
{
    mumbaiMinutes = "31";
}
else if (si_minutes == 2)
{
    mumbaiMinutes = "32";
}
else if (si_minutes == 3)
{
    mumbaiMinutes = "33";
}
else if (si_minutes == 4)
{
    mumbaiMinutes = "34";
}
else if (si_minutes == 5)
{
    mumbaiMinutes = "35";
}
else if (si_minutes == 6)
{
    mumbaiMinutes = "36";
}
else if (si_minutes == 7)
{
    mumbaiMinutes = "37";
}
else if (si_minutes == 8)
{
    mumbaiMinutes = "38";
}
else if (si_minutes == 9)
{
    mumbaiMinutes = "39";
}
else if (si_minutes == 10)
{
    mumbaiMinutes = "40";
}
else if (si_minutes == 11)
{
    mumbaiMinutes = "41";
}
else if (si_minutes == 12)
{
    mumbaiMinutes = "42";
}
else if (si_minutes == 13)
{
    mumbaiMinutes = "43";
}
else if (si_minutes == 14)
{
    mumbaiMinutes = "44";
}
else if (si_minutes == 15)
{
    mumbaiMinutes = "45";
}
else if (si_minutes == 16)
{
    mumbaiMinutes = "46";
}
else if (si_minutes == 17)
{
    mumbaiMinutes = "47";
}
else if (si_minutes == 18)
{
    mumbaiMinutes = "48";
}
else if (si_minutes == 19)
{
    mumbaiMinutes = "49";
}
else if (si_minutes == 20)
{
    mumbaiMinutes = "50";
}
else if (si_minutes == 21)
{
    mumbaiMinutes = "51";
}
else if (si_minutes == 22)
{
    mumbaiMinutes = "52";
}
else if (si_minutes == 23)
{
    mumbaiMinutes = "53";
}
else if (si_minutes == 24)
{
    mumbaiMinutes = "54";
}
else if (si_minutes == 25)
{
    mumbaiMinutes = "55";
}
else if (si_minutes == 26)
{
    mumbaiMinutes = "56";
}
else if (si_minutes == 27)
{
    mumbaiMinutes = "57";
}
else if (si_minutes == 28)
{
    mumbaiMinutes = "58";
}
else if (si_minutes == 29)
{
    mumbaiMinutes = "59";
}
else if (si_minutes == 30)
{
    mumbaiMinutes = "00";
}
else if (si_minutes == 31)
{
    mumbaiMinutes = "01";
}
else if (si_minutes == 32)
{
    mumbaiMinutes = "02";
}
else if (si_minutes == 33)
{
    mumbaiMinutes = "03";
}
else if (si_minutes == 34)
{
    mumbaiMinutes = "04";
}
else if (si_minutes == 35)
{
    mumbaiMinutes = "05";
}
else if (si_minutes == 36)
{
    mumbaiMinutes = "06";
}
else if (si_minutes == 37)
{
    mumbaiMinutes = "07";
}
else if (si_minutes == 38)
{
    mumbaiMinutes = "08";
}
else if (si_minutes == 39)
{
    mumbaiMinutes = "09";
}
else if (si_minutes == 40)
{
    mumbaiMinutes = "10";
}
else if (si_minutes == 41)
{
    mumbaiMinutes = "11";
}
else if (si_minutes == 42)
{
    mumbaiMinutes = "12";
}
else
{
    mumbaiMinutes = si_minutes - 30;
} // end if
var londonHours = amendHours(si_hours + 0);
var sydneyHours = amendHours(si_hours + 11);
var chicagoHours = amendHours(si_hours + 18);
var newyorkHours = amendHours(si_hours + 19);
var londonSummer = 0;
if (si_month == 3)
{
    londonSummer = 1;
} // end if
if (si_month == 4)
{
    londonSummer = 1;
} // end if
if (si_month == 5)
{
    londonSummer = 1;
} // end if
if (si_month == 6)
{
    londonSummer = 1;
} // end if
if (si_month == 7)
{
    londonSummer = 1;
} // end if
if (si_month == 8)
{
    londonSummer = 1;
} // end if
if (si_date >= 25 && si_year == 2007 && si_month == 2)
{
    londonSummer = 1;
} // end if
if (si_date >= 30 && si_year == 2008 && si_month == 2)
{
    londonSummer = 1;
} // end if
if (si_date >= 29 && si_year == 2009 && si_month == 2)
{
    londonSummer = 1;
} // end if
if (si_date >= 28 && si_year == 2010 && si_month == 2)
{
    londonSummer = 1;
} // end if
if (si_date < 28 && si_year == 2007 && si_month == 9)
{
    londonSummer = 1;
} // end if
if (si_date < 26 && si_year == 2008 && si_month == 9)
{
    londonSummer = 1;
} // end if
if (si_date < 25 && si_year == 2009 && si_month == 9)
{
    londonSummer = 1;
} // end if
if (si_date < 31 && si_year == 2010 && si_month == 9)
{
    londonSummer = 1;
} // end if
var newyorkSummer = 0;
if (si_month == 3)
{
    newyorkSummer = 1;
} // end if
if (si_month == 4)
{
    newyorkSummer = 1;
} // end if
if (si_month == 5)
{
    newyorkSummer = 1;
} // end if
if (si_month == 6)
{
    newyorkSummer = 1;
} // end if
if (si_month == 7)
{
    newyorkSummer = 1;
} // end if
if (si_month == 8)
{
    newyorkSummer = 1;
} // end if
if (si_month == 9)
{
    newyorkSummer = 1;
} // end if
if (si_date >= 11 && si_year == 2007 && si_month == 2)
{
    newyorkSummer = 1;
} // end if
if (si_date >= 9 && si_year == 2008 && si_month == 2)
{
    newyorkSummer = 1;
} // end if
if (si_date >= 8 && si_year == 2009 && si_month == 2)
{
    newyorkSummer = 1;
} // end if
if (si_date >= 14 && si_year == 2010 && si_month == 2)
{
    newyorkSummer = 1;
} // end if
if (si_date < 4 && si_year == 2007 && si_month == 10)
{
    newyorkSummer = 1;
} // end if
if (si_date < 2 && si_year == 2008 && si_month == 10)
{
    newyorkSummer = 1;
} // end if
if (si_date < 1 && si_year == 2009 && si_month == 10)
{
    newyorkSummer = 1;
} // end if
if (si_date < 7 && si_year == 2010 && si_month == 10)
{
    newyorkSummer = 1;
} // end if
if (sydneyHours == 0)
{
    sydneyHours = 24;
} // end if
if (londonSummer == 1)
{
    londonHours++;
    sydneyHours--;
} // end if
if (newyorkSummer == 1)
{
    newyorkHours++;
    chicagoHours++;
} // end if
if (hongkongHours < 10)
{
    hongkongHours = "0" + hongkongHours;
} // end if
if (singaporeHours < 10)
{
    singaporeHours = "0" + singaporeHours;
} // end if
if (mumbaiHours2 < 10)
{
    mumbaiHours2 = "0" + mumbaiHours2;
} // end if
if (dubaiHours < 10)
{
    dubaiHours = "0" + dubaiHours;
} // end if
if (londonHours < 10)
{
    londonHours = "0" + londonHours;
} // end if
if (sydneyHours < 10)
{
    sydneyHours = "0" + sydneyHours;
} // end if
if (chicagoHours < 10)
{
    chicagoHours = "0" + chicagoHours;
} // end if
if (newyorkHours < 10)
{
    newyorkHours = "0" + newyorkHours;
} // end if
if (hongkongHours == 24)
{
    hongkongHours = "00";
} // end if
if (singaporeHours == 24)
{
    singaporeHours = "00";
} // end if
if (mumbaiHours2 == 24)
{
    mumbaiHours2 = "00";
} // end if
if (dubaiHours == 24)
{
    dubaiHours = "00";
} // end if
if (londonHours == 24)
{
    londonHours = "00";
} // end if
if (sydneyHours == 24)
{
    sydneyHours = "00";
} // end if
if (chicagoHours == 24)
{
    chicagoHours = "00";
} // end if
if (newyorkHours == 24)
{
    newyorkHours = "00";
} // end if
_root.londonTime = londonHours + ":" + si_minutes;
_root.sydneyTime = sydneyHours + ":" + si_minutes;
_root.chicagoTime = chicagoHours + ":" + si_minutes;
_root.newyorkTime = newyorkHours + ":" + si_minutes;
_root.hongkongTime = hongkongHours + ":" + si_minutes;
_root.singaporeTime = singaporeHours + ":" + si_minutes;
_root.dubaiTime = dubaiHours + ":" + si_minutes;
_root.mumbaiTime = mumbaiHours2 + ":" + mumbaiMinutes;

```
