473,761 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time Zone and DateTime voes.

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 middle tier is in Eastern Time Zone. So the users in time
zones different from eastern time zone see the datetime adjusted to their
local time, which messes up the system. A lot of the datetimes we use are
just for storing dates only the time part is 00:00:00 and the problem is
some user whoose time zone is behind eastern time see this the date is off
by a day.
On searching internet some of the alternatives I found was to convert
datetiemes into string which is not possible in my case becase I have date
calculation going on the client.
What are my options here to rectify this issue ?

Thanks in advance.

--

Satish
Oct 16 '06 #1
3 2747
Satish,

I recommend storing, calculating, and manipulating times in UTC. When
it comes time to display the time to the end user then convert to the
local time zone. There are several advantages with this approach. Any
mistakes made in converting to the local time zone aren't as critical
since it only effects how the data is displayed and not how it's stored
or calculated. Also, you can completely ignore the effects of daylight
saving time except where displayed to the end user. The daylight
saving time logic can get a little complicated especially when dealing
with multiple time zones that have different definitions of it. Or
worse, the definitions change with time (ie. the United States will use
a different definition starting next year). And of course, you can
always assume 24 hours in a day when using UTC.

Brian

On Oct 16, 1:18 pm, "Satish Itty" <NO_SPAMsitty@c laytonDOTcomwro te:
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 middle tier is in Eastern Time Zone. So the users in time
zones different from eastern time zone see the datetime adjusted to their
local time, which messes up the system. A lot of the datetimes we use are
just for storing dates only the time part is 00:00:00 and the problem is
some user whoose time zone is behind eastern time see this the date is off
by a day.
On searching internet some of the alternatives I found was to convert
datetiemes into string which is not possible in my case becase I have date
calculation going on the client.
What are my options here to rectify this issue ?

Thanks in advance.

--

Satish
Oct 17 '06 #2
My problem is that for most of the cases I'm storing only the dates so I
dont really want them to converted to local time. Every user no matter what
time zone they are in should see the same date. But since Im using the date
time variable with time part as 00:00:00 when it get converted to the local
time of a time zone behind the server all the dates are off by a day.

--
HTH
Satish
"Brian Gideon" <br*********@ya hoo.comwrote in message
news:11******** *************@m 7g2000cwm.googl egroups.com...
Satish,

I recommend storing, calculating, and manipulating times in UTC. When
it comes time to display the time to the end user then convert to the
local time zone. There are several advantages with this approach. Any
mistakes made in converting to the local time zone aren't as critical
since it only effects how the data is displayed and not how it's stored
or calculated. Also, you can completely ignore the effects of daylight
saving time except where displayed to the end user. The daylight
saving time logic can get a little complicated especially when dealing
with multiple time zones that have different definitions of it. Or
worse, the definitions change with time (ie. the United States will use
a different definition starting next year). And of course, you can
always assume 24 hours in a day when using UTC.

Brian

On Oct 16, 1:18 pm, "Satish Itty" <NO_SPAMsitty@c laytonDOTcomwro te:
>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 middle tier is in Eastern Time Zone. So the users in
time
zones different from eastern time zone see the datetime adjusted to their
local time, which messes up the system. A lot of the datetimes we use are
just for storing dates only the time part is 00:00:00 and the problem is
some user whoose time zone is behind eastern time see this the date is
off
by a day.
On searching internet some of the alternatives I found was to convert
datetiemes into string which is not possible in my case becase I have
date
calculation going on the client.
What are my options here to rectify this issue ?

Thanks in advance.

--

Satish

Oct 17 '06 #3
PS

"Satish Itty" <NO_SPAMsitty@c laytonDOTcomwro te in message
news:eE******** ******@TK2MSFTN GP05.phx.gbl...
My problem is that for most of the cases I'm storing only the dates so I
dont really want them to converted to local time. Every user no matter
what time zone they are in should see the same date.
To see the same date they must also see the same time, i.e. at midnight
everyone no matter where they are moves to a new day. So base everything on
one time zone and that's what the time is no matter where you are in the
world.

PS

But since Im using the date
time variable with time part as 00:00:00 when it get converted to the
local time of a time zone behind the server all the dates are off by a
day.
>
--
HTH
Satish
"Brian Gideon" <br*********@ya hoo.comwrote in message
news:11******** *************@m 7g2000cwm.googl egroups.com...
>Satish,

I recommend storing, calculating, and manipulating times in UTC. When
it comes time to display the time to the end user then convert to the
local time zone. There are several advantages with this approach. Any
mistakes made in converting to the local time zone aren't as critical
since it only effects how the data is displayed and not how it's stored
or calculated. Also, you can completely ignore the effects of daylight
saving time except where displayed to the end user. The daylight
saving time logic can get a little complicated especially when dealing
with multiple time zones that have different definitions of it. Or
worse, the definitions change with time (ie. the United States will use
a different definition starting next year). And of course, you can
always assume 24 hours in a day when using UTC.

Brian

On Oct 16, 1:18 pm, "Satish Itty" <NO_SPAMsitty@c laytonDOTcomwro te:
>>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 middle tier is in Eastern Time Zone. So the users in
time
zones different from eastern time zone see the datetime adjusted to
their
local time, which messes up the system. A lot of the datetimes we use
are
just for storing dates only the time part is 00:00:00 and the problem is
some user whoose time zone is behind eastern time see this the date is
off
by a day.
On searching internet some of the alternatives I found was to convert
datetiemes into string which is not possible in my case becase I have
date
calculation going on the client.
What are my options here to rectify this issue ?

Thanks in advance.

--

Satish

Oct 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
35097
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
5266
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;
1
30150
by: Drew | last post by:
Is there a way to check if it is daylight savings or not via c#? I have heard you can use System.Globalization? Thanks - Drew
4
11856
by: P. George | last post by:
i have a table with a 'timstamp with time zone' column. when i insert into it: '18 Nov 2004 00:00:00 PST' ....it looks like: 2004-11-18 03:00:00-05
4
6248
by: Maziar Aflatoun | last post by:
Hi, Can someone please tell me how I can set DateTime to 01/01/1970 (UTC). Doing the following DateTime dt1 = new DateTime(1970, 1,1); Debug.WriteLine("dt1(utc):"+ dt1.ToUniversalTime().ToString()); Doing the following returns 1/1/1970 5:00:00 AM
15
2015
by: Cesar Ronchese | last post by:
Hi, I built the sample code showing the problem with dates when viewed at different machines, different Time Zones and transported via Remoting. The zip can be downloaded here: www.carsoftnet.com.br/temp/sample_error_date.zip
3
23750
by: Randall Parker | last post by:
Suppose one has a database of UTC times that are from different dates in the past. The problem with translating those times to a local time is that one does not know for each UTC time whether the local time at that same moment had daylight savings time in effect. If one has a local time it is easier to translate it into UTC time. One can get the UTC time and one can even calculate the number of hours difference between them as follows: ...
3
1814
by: bwooster47 | last post by:
Following python code prints out incorrect UTC Offset - the python docs say that %z is not fully supported on all platforms - but on Linux Fedora FC5, perl code works and python does not - is this a bug or is this expected behavior? For a EST timezone setup, Perl prints correct -0500, while Python prints +0000 - this is Python 2.4. Perl: $now_string = strftime "%Y-%m-%d %H:%M:%S %Z%z", localtime; print $now_string, "(iso local)\n";
2
5081
by: nightwatch77 | last post by:
Hi, does anyone know why .Net incorrectly handles time zone conversion when passing DateTime through web services? The problem is that it seems to ignore the time zone part. My time zone is CEST, that is GMT +01:00 + daylight saving. And the web service handles datetimes correctly provided that they are also in CEST. But when some client calls my web service passing dates in UTC, the .Net runtime just ignores that fact and takes just the...
0
9554
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
9377
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9925
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
9811
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
8814
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
7358
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
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.