From: ljb <lbayuk@pobox.com>
To: pgsql-sql@postgresql.org
Subject: Re: timestamps over the web - suggestions
Date: Wed, 4 Oct 2006 01:35:36 +0000 (UTC)
Message-ID: <efv357$2qf4$1@news.hub.org> (raw)
References: <20061003214412.82918.qmail@web54302.mail.yahoo.com>
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>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: lbayuk@pobox.com
Subject: Re: timestamps over the web - suggestions
In-Reply-To: <efv357$2qf4$1@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox