473,809 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time zone

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
5 2392
Hi,

"Sehboo" <Ma*********@gm ail.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.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
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...@gm ail.comwrote in message

news:11******** **************@ n59g2000hsh.goo glegroups.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
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*********@gm ail.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.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
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
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.d kwrote in message
news:45******** *************** @news.sunsite.d k...
| 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6305
by: MLH | last post by:
I would like to be able to look up any 5-digit ZIP in a table that would show the correct time zone for the area. For example, I would like to look up 91915 in the table and see something that indicates Pacific Time Zone or 27615\ would be found as Eastern Time Zone. I guess I want Eastern Time Zone, Central Time Zone, Mountain Time Zone, Pacific Time Zone, Atlantic Time Zone along with Palau, Hawaii, Guam and all the others for the...
3
35108
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
10
5269
by: Marc Pelletier | last post by:
Hello, I am writing an application that does some simple astronomical calculations. One of the variables I need is the number of hours passed in this year. I've written the following function public static double GetHoursofYear( DateTime aTime ) { DateTime StartYear = new DateTime( aTime.Year, 1, 1 ); return ( aTime.ToOADate() - StartYear.ToOADate() ) * 24;
2
24629
by: Avi | last post by:
I have a problem to get the different time zone's name for example I need the name of time zone UTC + 4:30 ("Kabul") The TimeZone.CurrentTimeZone get my current time zone name and I couldn't see how to get a different time zone name please hlp this is very important. Avi
1
2328
by: Clodoaldo Pinto Neto | last post by:
Hi all, I want to have the time zone string (like 'BRT') displayed after a date-time. The date column is of the type timestamp with time zone. But the time zone is not displayed. It works for a timestamp without time zone column: # select to_char(timestamp '2001-02-16 20:38:40' at time zone 'BRT', 'HH24:MI DD/MM/YYYY TZ'); to_char
14
2657
by: Cesar Ronchese | last post by:
Hello! I've built a program that show some dates to users. I got a problem when users have different configured time zone machines, where: - One machine that determined time zone the date displayed is 01/01/2006. - In other different machine (and other configured time zone), the date displayed is 12/31/2006 19:00:00 If I redefine the time zones of these two machines to the same, the date
2
14697
by: Mike | last post by:
I'm writing an application for Windows XP Embedded. This application requires that the user be able to change the time zone from within the application. I'm trying to do this using SetTimeZoneInformation, but it's not working correctly and I can't figure out why. I'm using Visual C# to write the application. The problem I'm having is that if I choose US Eastern Time (-5:00) Eastern Time (US & Canada) then the code below winds up setting...
3
2748
by: Satish Itty | last post by:
Hi all, I have a big problem in my hands and not sure how I can fix this. Any suggestions would be greatly appreciated. I have a .NET 3 tier app developed in VS2003 and .NET 1.1. the client is a windows application and middle tier runs on IIS. Data is passed between the client and middle tier as DataSets and custom value object classes. The problem in my hand is that the client application is deployed in different time zones and the...
7
5512
by: Steve | last post by:
Hi All I have a windows application written in VB.net 2005 The users have to select a State of Australia, which I use to check they have the correct windows time zone selected in control panel Dim myzone As TimeZone = TimeZone.CurrentTimeZone If they change the Time zone whilst my application is running, a new call to Dim myzone As TimeZone = TimeZone.CurrentTimeZone returns the same time zone NOT the new one They have to restart my...
7
2737
by: Correia | last post by:
I have a webserver that is in another country and have a different time zone. How can i fix this and use the scripts with the correct time zone? Thanks
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10639
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10383
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.