Time zone

S

Sehboo

We have a c# application (with about 100 forms, and 300+ tables on sql
server).

We have several customers who use that application but everybody gets
the copy of the database. Structure of the database is same, but with
different data. All the databases reside on the same server/same
instance.

We need to make that app time-zone aware. Is there a way in SQL
Server 2000 database (or web.config file) to change the time zone?
This way we won't have to change much in the application or database,
we will just change the setting to "eastern" or "central" timezone and
everything will fall in place. Otherwise we will have to touch so
many tables and forms that it could take weeks/months.

Any quick solutions?

Thanks
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

We need to make that app time-zone aware. Is there a way in SQL
Server 2000 database (or web.config file) to change the time zone?
This way we won't have to change much in the application or database,
we will just change the setting to "eastern" or "central" timezone and
everything will fall in place. Otherwise we will have to touch so
many tables and forms that it could take weeks/months.

If you change the setting to the server it will change ti globally so it's
not good for you.

Can you detect some how from what timezone a particular client is coming
from?
 
V

VJ

This client based, not sure if changing things in sever is going to help.
Even if you alter anything in the DB or Webserver, that will change other
requests coming to the server from different time zone. Almost like a ASP
page reading client time, based client side scripting.

So if you are doing to client based, that means you are going to have to go
through the change.. Guess no easy way out, if that is what you looked for.

VJ
 
S

Sehboo

Well, what if I change the database setting?

Yes, I know exactly what timezone to set for each customer, and since
all the customers have their own database, there won't be any
confusion, but how/where to set timezone in database?
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Sehboo said:
Yes, I know exactly what timezone to set for each customer, and since
all the customers have their own database, there won't be any
confusion, but how/where to set timezone in database?

I think you are taking the wrong approach.

Store all time info in DATETIME columns.

Never let the server set the time - always set the
time from the client apps.

Always use parameters both to set and get the time.

Then it should always work, because
the timezone of the server does not matter. You send
binary time forth and back all the time.

Arne
 
W

William Stacey [C# MVP]

I would add another thing. Always get, set, calc, and store only UTC
datetimes. That way, you never have any date confusion. Your client side
can easily convert to/from UTC so they can display local times. This also
makes it possible for same client to store a record in home time zone and
change their time zone when they travel and still get and use the datetime
correctly because it converted from UTC and it just works even on their new
timezone.

--
William Stacey [C# MVP]
PCR concurrency library: www.codeplex.com/pcr
PSH Scripts Project www.codeplex.com/psobject


| Sehboo wrote:
| > Yes, I know exactly what timezone to set for each customer, and since
| > all the customers have their own database, there won't be any
| > confusion, but how/where to set timezone in database?
|
| I think you are taking the wrong approach.
|
| Store all time info in DATETIME columns.
|
| Never let the server set the time - always set the
| time from the client apps.
|
| Always use parameters both to set and get the time.
|
| Then it should always work, because
| the timezone of the server does not matter. You send
| binary time forth and back all the time.
|
| Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top