Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simplified users Timezone handling

0 views
Skip to first unread message

David Balažic

unread,
Nov 19, 2009, 4:57:49 AM11/19/09
to
Hi!

In version 3.4.3 for the displaying times and dates in users timezone,
currently this is required:
- a bunch of code on the server (bugzilla)
- user must login (on each visit, unless "cookied")
- user must set timezone in preferences


I suggest a much simpler solution:
- a few lines of code in the server

That's it. No user action required.

This solution also automatically handles daylight saving time changes.

It puzzles me why (web) server software writers go through all this
trouble when a few lines of code does it all ;-)

The code (as sent to users web browser):

Time of action (in your local tz !): <script type="text/javascript">
<!--
var time1 = new Date(654323545*);
Document.write(time1.toLocaleString());
//-->
</script><noscript>2002-11-27 08:09 PDT**</noscript>

* - the time as miliseconds since epoch inserted by server
** - regular time inserted by server, as it is done now (or before,
when it was always in servers TZ)

It needs Java/ECMAScript, obviously, so the NOSCRIPT fallback.
JS is already used so while many (me included) think JS is evil, this
is no change in that regard.
If user happens to have no JS (or have disabled it), a fallback to old
behavior is done, so no harm.

Regards,
David

Max Kanat-Alexander

unread,
Nov 19, 2009, 6:36:42 PM11/19/09
to support-...@lists.mozilla.org
Note: This would be better on the developers list. (I've rarely ever
had to say that! :-) )

On 11/19/2009 01:57 AM, David Balažic wrote:
> Time of action (in your local tz !): <script type="text/javascript">
> <!--
> var time1 = new Date(654323545*);
> Document.write(time1.toLocaleString());
> //-->
> </script><noscript>2002-11-27 08:09 PDT**</noscript>

That works for HTML pages. We'd still need the server-side code for the
non-HTML pages. Also, we'd be dependent upon users actually having the
timezone and time set correctly on their local installations, which
would probably lead to a lot of strange bug reports. But I've thought
about the JS solution as well, myself. It's just going to be
*additional* code for us, not less code.

-Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.

David Balažic

unread,
Nov 20, 2009, 5:57:45 AM11/20/09
to
On Nov 20, 12:36 am, Max Kanat-Alexander <mka...@bugzilla.org> wrote:

>         That works for HTML pages. We'd still need the server-side code for the
> non-HTML pages. Also, we'd be dependent upon users actually having the
> timezone and time set correctly on their local installations, which
> would probably lead to a lot of strange bug reports.

If they would have it like that, they would get a lot of other
problems.
Besides setting the TZ on one owns PC is still easier (and probably
done by the person who installed the OS) than setting it on
all websites you use. And that works only after you log in.
And it may not even list your own timezone (see bug 529774).

I don't know about non-HTML pages, can you give an example? The mail
notifications

Regards,
David

PS: What/where si the developers list? devel...@bugzilla.org ?

Max Kanat-Alexander

unread,
Nov 20, 2009, 6:16:35 PM11/20/09
to support-...@lists.mozilla.org
On 11/20/2009 02:57 AM, David Balažic wrote:
> I don't know about non-HTML pages, can you give an example? The mail
> notifications

Atom, XML, Email, etc.

> PS: What/where si the developers list? devel...@bugzilla.org ?

Yes.

0 new messages