Re: timestamps over the web - suggestions
| От | ljb |
|---|---|
| Тема | Re: timestamps over the web - suggestions |
| Дата | |
| Msg-id | efv357$2qf4$1@news.hub.org обсуждение исходный текст |
| Ответ на | timestamps over the web - suggestions (chester c young <chestercyoung@yahoo.com>) |
| Список | pgsql-sql |
chestercyoung@yahoo.com wrote: > > My server is based MST, but web clients from Maine to Hawaii, and they wish to see timestamps based in their own locale. > > Can anyone tell me how they're handling this? (sorry - can't get rid of my clients) Here's a bit of JavaScript that might work for you. It sets a cookie to the user's timezone offset (vs GMT, in minutes). You put something like this on an initial page (portal, login page, whatever), and then subsequent pages will be requested along with the timezone cookie. If you are using PHP, for example, your scripts just access $_COOKIE['timezone'] and adjust things accordingly for the user's timezone. <script language="JavaScript1.1"><!-- var d = new Date(); document.cookie = "timezone="+d.getTimezoneOffset(); --></script>
В списке pgsql-sql по дате отправления: