santanudas
Technical User
Hi people,
I'm very very new in this flash world (just a 2 weeks old of experiences, so far) and I found the ActionScript (especially v3) is really cool. So I started with making clock, not the the one which takes time off the system clock but a clock with different timezone(s). I didn't find any clean straight way of doing that other than adding or subtracting the time difference(s) to/from UTC time. Is that only way of doing this in flash?
While doing that, I found it's very easy for the time zones those have compete hours of difference; i.e. Tokyo: +9 or NYC: -4 and I do like this:
and it works absolutely fine. But the problem I face for the time zones have hours and half difference; i.e. India: -5:30 [five & half hrs of difference]. How can I do that? Any help/hint(s) would be very much appreciated.
Sorry, if my question sounds silly and many thanks in advance for replying. Cheers!!!
I'm very very new in this flash world (just a 2 weeks old of experiences, so far) and I found the ActionScript (especially v3) is really cool. So I started with making clock, not the the one which takes time off the system clock but a clock with different timezone(s). I didn't find any clean straight way of doing that other than adding or subtracting the time difference(s) to/from UTC time. Is that only way of doing this in flash?
While doing that, I found it's very easy for the time zones those have compete hours of difference; i.e. Tokyo: +9 or NYC: -4 and I do like this:
Code:
var now:Date = new Date();
var utc_date = now.getUTCDate();
var utc_sec = now.getUTCSeconds();
var utc_min = now.getUTCMinutes();
var utc_hrs = now.getUTCHours();
var new_seconds = utc_sec;
var nw_minutes = utc_min;
var new_hours = utc_hrs+9;
Sorry, if my question sounds silly and many thanks in advance for replying. Cheers!!!