This content has been marked as final. Show 5 replies
local to what?
the server? if so, use server-side script to return the server time. local to
the user? if you're willing to assume the user's local time is accurate you can retrieve that with the flash date class.
otherwise, you're out of luck.
Thank you for replying to my query, I created the first prototype of the Countdown timer you can view it @ the link below to understand what I am trying to achieve:
I am a beginner to programming, so please bear with me in trying to conclude what I mean to convey to you.
A snippet of AS that I want to implement:
// I want to place a routine here that checks the locale of the user.
// Adjust a variable based on the locale
var today:Date = new Date();
var currentYear = today.getFullYear();
var usersHour:Array = new Array(0,0);
// Pseudo code
if users locale is Ireland
switch usersHour to 19 and usersHour to 45
if users locale is EST
switch usersHour to 14 and usersHour to 45
I wish to use about 5 Timezones
switch usersHour to 20 and usersHour to 45
var targetDate:Date = new Date(currentYear, 5, 29, usersHour, usersHour);
I hope this is clear and cogent to you!
when you use the date() object you're obtaining local time/date as set on the user's computer. if you're willing to assume that time is set accurately, you can use that along with the your server's time/date to determine the user's timezone.
Can I be so bold as to ask, could you point me in the direction of retrieving the servers Timezone!
you need to use server-side scripting. in php, check the time() or date() functions. depending on the server you may need to use an environmental variable to fix the timezone of the returned time/date.