Re: timestamps over the web - suggestions

From: ljb <lbayuk(at)pobox(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: timestamps over the web - suggestions
Date: 2006-10-04 01:35:36
Message-ID: efv357$2qf4$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

chestercyoung(at)yahoo(dot)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>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2006-10-04 04:11:50 Re: Fw: How to FindNearest
Previous Message Aaron Bono 2006-10-04 01:15:49 Re: timestamps over the web - suggestions