By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,198 Members | 1,698 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,198 IT Pros & Developers. It's quick & easy.

Time zone

P: n/a
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

Mar 14 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

"Sehboo" <Ma*********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
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?

Mar 14 '07 #2

P: n/a
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?

On Mar 14, 10:20 am, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:
Hi,

"Sehboo" <MasoodAd...@gmail.comwrote in message

news:11**********************@n59g2000hsh.googlegr oups.com...
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?

Mar 14 '07 #3

P: n/a
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

"Sehboo" <Ma*********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
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

Mar 14 '07 #4

P: n/a
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
Mar 15 '07 #5

P: n/a
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
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:45***********************@news.sunsite.dk...
| 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
Mar 15 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.