Multiple time zones 1 server?

This is a discussion on Multiple time zones 1 server? within the Linux General forums, part of the Linux Forums category; Hi people, I have an interesting conundrum. We run as a small ISP for clients as a side business. We ...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-28-2003
graham Dinning
 
Posts: n/a
Default Multiple time zones 1 server?

Hi people,
I have an interesting conundrum. We run as a small ISP for clients as a
side business.
We have a single server that does everything running RH7.2. it runs DNS,
mail, web, webmail, java, tomcat, database etc etc.
The boss sent an email yesterday asking id we could use GMT for our
clients overseas and stay local time for our clients in oz.
This is a valid enough request.
The people in england want to see their reports etc in their time and the
clients in oz want the same.
If I ask the question of people I know I get "Use UTC and everone can just
cope".

Is there a solution to this problem or do people just run another box for
this kind of situation. Thinking about it it seems that you would have to
run little virtual servers or different boxes.
Is this actually the case or is there something out there already that
solves this problem. I have been looking in lots of places and can't seem to
find any good answers.

Thanks in advance
Graham


Reply With Quote
  #2 (permalink)  
Old 07-28-2003
David Efflandt
 
Posts: n/a
Default Re: Multiple time zones 1 server?

On Mon, 28 Jul 2003, graham Dinning <gdinning@resmaster.com> wrote:
> Hi people,
> I have an interesting conundrum. We run as a small ISP for clients as a
> side business.
> We have a single server that does everything running RH7.2. it runs DNS,
> mail, web, webmail, java, tomcat, database etc etc.
> The boss sent an email yesterday asking id we could use GMT for our
> clients overseas and stay local time for our clients in oz.
> This is a valid enough request.
> The people in england want to see their reports etc in their time and the
> clients in oz want the same.
> If I ask the question of people I know I get "Use UTC and everone can just
> cope".
>
> Is there a solution to this problem or do people just run another box for
> this kind of situation. Thinking about it it seems that you would have to
> run little virtual servers or different boxes.
> Is this actually the case or is there something out there already that
> solves this problem. I have been looking in lots of places and can't seem to
> find any good answers.
>
> Thanks in advance
> Graham


I help someone with a virtual host on FreeBSD 4.4-RELEASE. Apache and
sendmail run within their home dir (chroot jail). But that requires that
all necessary binaries, libs, perl, etc. be within the chroot jail. When
logged into the shell, it is not within the virtual jail, but a virtual
command can be used to test things there. For example:

% date
Mon Jul 28 01:58:12 GMT 2003
% virtual date
Sun Jul 27 20:58:24 CDT 2003

So apache and sendmail logs would be in the user's timezone.

Time zone could also possibly be set in the user's login shell if the
system is set up properly for that. Just an example of how setting
timezone (TZ) in environment affects date:

#!/bin/sh
date
export TZ="UTC"
date
export TZ="PST8PDT"
date

prints:

Sun Jul 27 21:11:31 CDT 2003
Mon Jul 28 02:11:31 UTC 2003
Sun Jul 27 19:11:31 PDT 2003


--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
Reply With Quote
  #3 (permalink)  
Old 07-28-2003
John Winters
 
Posts: n/a
Default Re: Multiple time zones 1 server?

In article <3f2470d8$0$95050$c30e37c6@lon-reader.news.telstra.net>,
graham Dinning <gdinning@resmaster.com> wrote:
>Hi people,
> I have an interesting conundrum. We run as a small ISP for clients as a
>side business.
>We have a single server that does everything running RH7.2. it runs DNS,
>mail, web, webmail, java, tomcat, database etc etc.
> The boss sent an email yesterday asking id we could use GMT for our
>clients overseas and stay local time for our clients in oz.
>This is a valid enough request.
>The people in england want to see their reports etc in their time and the
>clients in oz want the same.
>If I ask the question of people I know I get "Use UTC and everone can just
>cope".


The normal way of working is that the box uses GMT/UTC internally and
then date-times are presented to users in the format they expect. (Bear
in mind that this is purely a presentation issue.)

What sort of applications are your users running to generate these
reports? Can they not just get different TZ settings as they log in?

John
--
The Linux Emporium - the source for Linux in the UK
See http://www.linuxemporium.co.uk/

We had a woodhenge here once but it rotted.
Reply With Quote
  #4 (permalink)  
Old 07-28-2003
news@roaima.freeserve.co.uk
 
Posts: n/a
Default Re: Multiple time zones 1 server?

graham Dinning <gdinning@resmaster.com> wrote:
> The boss sent an email yesterday asking id we could use GMT for our
> clients overseas and stay local time for our clients in oz.


Yes...

> This is a valid enough request.


> The people in england want to see their reports etc in their time and the
> clients in oz want the same.
> If I ask the question of people I know I get "Use UTC and everone can just
> cope".


The normal approach is to run the server in UTC and then set the
timezone appropriately for different users. For example, in the UK
the timezone should be "GB-Eire". For folks in Queensland, I believe
the correct timezone would be "Australia/Queensland". You can look in
/usr/share/zoneinfo for more time zone labels.

Consider:
$ TZ=Australia/Queensland date
Mon Jul 28 20:53:30 EST 2003

$ TZ=GB-Eire date # UK; also Europe/London
Mon Jul 28 11:53:30 BST 2003

$ TZ=Europe/Paris date # France
Mon Jul 28 12:53:30 CEST 2003

$ TZ=EST5EDT date # USA Eastern; also America/New_York
Mon Jul 28 06:53:30 EDT 2003

All are correct, and all represent the same instant in time.
Chris
--
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
Reply With Quote
  #5 (permalink)  
Old 07-28-2003
Wayne Pollock
 
Posts: n/a
Default Re: Multiple time zones 1 server?

The default time is created from a file /etc/localtime. This is
a copy or symlink to one of the timezone files in /usr/share/timezone.
These are compiled timezone files (from "zic").

For users not using the default, the TZ environment variable should
be set and exported in their login script.

I don't know how you can make apache sensitive to timezones, but
you can get close enough for your particular situation. Apache
can be made to return different pages depending on the "locale"
of the client's browser. You can have different clients map to
different URLs or CGIs, which can then set TZ in their environment.

Hope this helps!

-Wayne

P.S. When I worked for Bell Labs in the early 1980s, the time
zone was compiled into the kernel! To change the timezone
meant to recompile the kernel, and there was only a single
zone for all users. All commercial Unixes at the time came
with enough .o files and source to change the zone and rebuild
the kernel!

graham Dinning wrote:

> Hi people,
> I have an interesting conundrum. We run as a small ISP for clients as a
> side business.
> We have a single server that does everything running RH7.2. it runs DNS,
> mail, web, webmail, java, tomcat, database etc etc.
> The boss sent an email yesterday asking id we could use GMT for our
> clients overseas and stay local time for our clients in oz.
> This is a valid enough request.
> The people in england want to see their reports etc in their time and the
> clients in oz want the same.
> If I ask the question of people I know I get "Use UTC and everone can just
> cope".
>
> Is there a solution to this problem or do people just run another box for
> this kind of situation. Thinking about it it seems that you would have to
> run little virtual servers or different boxes.
> Is this actually the case or is there something out there already that
> solves this problem. I have been looking in lots of places and can't seem to
> find any good answers.
>
> Thanks in advance
> Graham
>
>


Reply With Quote
  #6 (permalink)  
Old 07-29-2003
John Hasler
 
Posts: n/a
Default Re: Multiple time zones 1 server?

Steffen writes:
> That is correct. However, with webservers creating HTML on the fly, you
> have the problem that the server doesn't know which timezone presentation
> to generate for the client.


The server should send UTC or local time with offset and the client should
translate it appropriately.
--
John Hasler
john@dhh.gt.org
Dancing Horse Hill
Elmwood, Wisconsin
Reply With Quote
  #7 (permalink)  
Old 07-29-2003
Steffen Kluge
 
Posts: n/a
Default Re: Multiple time zones 1 server?

According to John Hasler <john@dhh.gt.org>:
>The server should send UTC or local time with offset and the client should
>translate it appropriately.


Ah, as I said, I'm quite oblivious to HTML. So there is tag for
date/time that is to be interpreted by the client?

Cheers
Steffen.

Reply With Quote
  #8 (permalink)  
Old 07-29-2003
John Hasler
 
Posts: n/a
Default Re: Multiple time zones 1 server?

I wrote:
> The server should send UTC or local time with offset and the client
> should translate it appropriately.


Steffen writes:
> Ah, as I said, I'm quite oblivious to HTML. So there is tag for date/time
> that is to be interpreted by the client?


No, but there should be.
--
John Hasler
john@dhh.gt.org
Dancing Horse Hill
Elmwood, Wisconsin
Reply With Quote
  #9 (permalink)  
Old 07-29-2003
Ed Murphy
 
Posts: n/a
Default Re: Multiple time zones 1 server?

On Tue, 29 Jul 2003 12:38:06 +0000, Steffen Kluge wrote:

> According to John Winters <john@linuxemporium.co.uk>:
>>The normal way of working is that the box uses GMT/UTC internally and
>>then date-times are presented to users in the format they expect. (Bear
>>in mind that this is purely a presentation issue.)

>
> That is correct. However, with webservers creating HTML on the
> fly, you have the problem that the server doesn't know which
> timezone presentation to generate for the client.
>
> I'm no HTTP expert, but I don't think it caters for that yet.
> Things like this should be communicated from client to server,
> for example as parameter to the HEAD command. Till then, one
> has to pull tricks.


This can be stored/retrieved using a cookie, or using a GET or POST
parameter to whatever CGI script generates the output. I don't see
what's special about timezone in this respect; am I missing something?

Reply With Quote
  #10 (permalink)  
Old 07-29-2003
Steffen Kluge
 
Posts: n/a
Default Re: Multiple time zones 1 server?

According to Ed Murphy <emurphy42@socal.rr.com>:
>This can be stored/retrieved using a cookie, or using a GET or POST
>parameter to whatever CGI script generates the output. I don't see
>what's special about timezone in this respect; am I missing something?


Cookies just store information at the client for later retrieval
by the server. There doesn't seem to be a standardised mechanism
for asking the client "what timezone are you in?".

Any self-respecting client wouldn't appreciate such interrogation
anyway, that's why a tagged date/time format is preferable.

Cheers
Steffen.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:32 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0