Forum OpenACS Development: TimeZone Setup

Collapse
Posted by Cesareo Garci­a Rodicio on
Hi!

I have some problems with my timezone setup. My current setup is:

OS Time: Mon, 28 Aug 2006 15:07:45 -0600

OpenACS data:
Current time, according to the database: 2006-08-28 15:07:45
OpenACS Timezone setting: America/Denver
Difference between database time and UTC according to OpenACS timezone setting above: -6 hours
UTC time according to database and the OpenACS timezone setting above: 2006-08-28 21:07:45

BUT, America/Denver is GMT -7 not -6 . I suppose is because of DST but I don't know.

Anyone knows? have I set something wrong?

Collapse
2: Re: TimeZone Setup (response to 1)
Posted by Dave Bauer on
Yes it is because of daylight savings time.
Collapse
Posted by Cesareo Garci­a Rodicio on
Hi Dave

So. Do I have to change it every DST change?

Because, my problem was with two things:

-In Calendar (view day)
-Custom code:

"
set hora_server [ns_fmttime [ns_time] "%Y-%m-%d %H:%M:%S"]
set hora_utc [lc_time_local_to_utc $hora_server ]
set hora_local [lc_time_system_to_conn $hora_server ]
"

I've found some inconsistencies. For example, hora_server is one hour more that real time. hora_local is fine but hora_utc is wrong (one hour less).

So how can I do the right setup? Do you know?
Server Time: GMT -7
User Local Time: GMT -5 (even though I could change sometimes)

Thanks
Cesareo

Collapse
4: Re: Res: TimeZone Setup (response to 1)
Posted by Cesareo Garci­a Rodicio on
Hi Dave (or anyone)

So how can I set up my server? My problem is related to this old post about a problem with Calendar.

I'm trying to solve that and I found that, now (1 hour diff problem) if I try to set up an appoinment for 15:00, it seems to be that calendar thinks it was 14:00

Thanks
Cesareo

Collapse
5: Re: TimeZone Setup (response to 1)
Posted by Dave Bauer on
I think the main problem is that the time is stored with one time zone and displyed with another, and its not converting the data correctly.

That is, when displaying the time, the system needs to convert the timezone stored in the database to the correct system timezone for display.

Collapse
6: Re: Res: TimeZone Setup (response to 1)
Posted by Cesareo Garci­a Rodicio on
So, do you think it is a OpenACS bug or perhaps my misconfiguration?

Because, the problem is what you say: I'm a user with a GMT-5 timezone working on a server with a GMT-6 timezone (eventhough I had to set up a GMT - 7 timezone to work properly because of DST).

What do you think?

Thanks
Cesareo

Collapse
Posted by Cesareo Garci­a Rodicio on
Hi !

Please look at this:

Code:

set hora_server [ns_fmttime [ns_time] "%Y-%m-%d %H:%M:%S"]
set hora_utc [lc_time_local_to_utc $hora_server ]
set hora_local [lc_time_system_to_conn $hora_server ]

Result:

Hora Servidor : 2006-08-31 15:22:13 (It's hora_server)
Hora UTC: 2006-08-31 20:22:13 (It's hora_utc)
Mi hora: 2006-08-31 16:22:13 (It's hora_local)

So, my conclusions:

Server Time (GMT -6) seems to be OK
UTC Time FAILED: It must be 21:22 (15:22 + 6, not 5)
User Local time (GMT -5)

As I said before, my server time is GMT -6 but I had to put in OpenACS setup SystemTimezone America/Denver that appears with GMT -7

So, it seems to be a bug in OpenACS?