Home > Archive > SQL Anywhere database > April 2005 > How to obtain Time Zone









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to obtain Time Zone
Alex Naumenko

2005-04-21, 8:23 pm

Hi,

Does anybody know how to obtain current Time Zone in stored procedure.
I obtain it now in the following way:

property('TimeZoneAd
justment')/60

it works great when it is NOT a daylight saving time. During daylight saving
time this method returns value with 1 hour difference (not adjusted to
daylight saving time).
Should I write code to check when daylight time starts and ends, or there is
another way to obtain Time Zone?

I am running ASA 9.0.2.3044

Thank you,
Alex.


Kumar

2005-04-21, 8:23 pm

Hi Alex -

I'm not sure about doing it in the DB, but... What we do on our client
application, however, is to compare the TimeZoneBias between the client and
the server with something like below. The ServerTimeZoneBias is passed from
the server, then compared to the workstation's timezonebias to see how many
hours ahead/behind the client is in relation to the server. If the window's
timezone is setup correctly on the server and the workstations, then you
don't have to worry about Daylight savings time as it is already being
tested for in the TimeZoneBias.

function GetBaseTimeOffset: Double;
begin
result := (ServerTimeZoneBias - (TimeZoneBias));
if (result > -0.00001) and (result < 0.0001) then
result := 0;

end;


Hope that helps,

-k-

"Alex Naumenko" <alexn@esna.com> wrote in message
news:4267fee3@forums
-2-dub...
> Hi,
>
> Does anybody know how to obtain current Time Zone in stored procedure.
> I obtain it now in the following way:
>
> property('TimeZoneAd
justment')/60
>
> it works great when it is NOT a daylight saving time. During daylight
> saving
> time this method returns value with 1 hour difference (not adjusted to
> daylight saving time).
> Should I write code to check when daylight time starts and ends, or there
> is
> another way to obtain Time Zone?
>
> I am running ASA 9.0.2.3044
>
> Thank you,
> Alex.
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com