help with time please!!

  • ironn_
  • Born
  • Born
  • ironn_
  • Posts: 1

Post 3+ Months Ago

hi, i´m in a hurry and i have an urgent problem. i´m developing a site for a sudamerican organization and what they asked me to do is to display the names of all the countries in it, with their respective time besides the name of the country. i thought of using the time functions that actionscript provides and add manually the difference in time. but this will only work if you login through a specific country. example: brasil = argentina + 1. but to do this i took one country as the default, when it shouldn´t be like this. if you are in argentina, it would work, but if you are in brasil, your time would be "read" as argentina´s time, and the one displayed would be one hour later than yours.
my question then: is there a function where i can find US time from a website for example, and then make calculations manually for the other countries?
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2696
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

You should always use UTC or GMT as the reference. -- the rest of the world does.

Set up ntpd, network time protocol daemon on a box, point it at an ntp server, set ref to GMT. This gives you a machine that has constant correct time, within <variable> skew.

Then it's merely a matter of associating a country with a variable variation off of GMT.

As an example, EST, Eastern Standard Time in the US is GMT - 5. Of course, you will have to code in the deviations given daylight savings time, and the countries (states) which participate. That would require some specific coding, as UTC time does not alter.

I suggest starting here;


Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 40 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.