473,548 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time Zone question

This is just a general question....try ing to collect some ideas on how to
approach this issue:

I have a web app that has users across the country. Since they login, I can
make their profiles have a time zone field, so that's no big deal.

My data in question is stored in SQL 2000 in a datetime type and the server
is set to Eastern time. My first question is: Is the date stored on the
server stored as something like GMT format or does it get stored as the
eastern time? If it's stored in Eastern Time, I would assume I have to use
the Transact SQL function GetUTCDate() to convert it to GMT....then
reconvert it in my app to the users time zone?

I also have users in Indiana, where the time zones never "spring ahead/fall
behind" so I need to make sure their dates don't adjust when the east coast
does. Is there a common function I could use to do this mess for me...so I
don't have to keep track of the calendar date when daylight savings
starts/ends?

I'm also pondering how I should handle some of the reporting features; for
example. If the main office is headquartered on the east cost, their normal
business day would be from 12:00am to 11:59:59pm. so if they ran a sales
report for that day, it would be fine. However if a west coaster ran a
report for the day's sales, should I make sure their report's time is set to
Eastern...other wise it would try to capture data from 9:00pm to 11:59:59pm,
thus skewing the report....

Thanks for your feedback.

-- Rob T.
Nov 18 '05 #1
1 1740
> My data in question is stored in SQL 2000 in a datetime type and the
server
is set to Eastern time. My first question is: Is the date stored on the
server stored as something like GMT format or does it get stored as the
eastern time?
It is stored as whatever you inserted. If you put in 12:07 PM, it is 12:07
PM. The database doesn't know if you consider that to be GMT, or EST, etc.
If it's stored in Eastern Time, I would assume I have to use
the Transact SQL function GetUTCDate() to convert it to GMT
GETUTCDATE() returns GETDATE() +- the *current* UTC offset. Which is not
necessarily the same as what it would yield for April 12th of this year or
November 14th of last year. See the problem?
should I make sure their report's time is set to
Eastern...
That really depends on the business requirements. Are they only querying
for sales that *happened* in their time zone? What do the users expect?
otherwise it would try to capture data from 9:00pm to 11:59:59pm,


Why wouldn't it be >= 9:00 PM on day x and < 9:00 AM on day (x+1)?

To deal with UTC I usually have a calendar table with a UTCOffset column;
you can probably do something like this with a column for the offset in each
time zone you plan on supporting.

http://www.aspfaq.com/2519
http://www.aspfaq.com/2218

--
http://www.aspfaq.com/
(Reverse address to reply.)
Nov 18 '05 #2

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

Similar topics

3
35059
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
2
1780
by: Daniel Jung | last post by:
Hi 1088553069 => Wed Jun 30 01:51:22 2004 CEST I can do the time INT string substitution, but I want a set of "country codes", in order for my users to be able to pick their own preferences. This set should include American and European date format (`month/day' vs. `day.month'), American and European time (AM/PM vs. 24hours).
5
5776
by: ECVerify.com | last post by:
I am trying to convert a computers local time to Pacific time, I can get it back to UTC pretty easy but I actually want to convert whatever the local time is on the computer I want to calculate what it would currently be in Pacific time. Taking in account Daylight Savings Time Thanks, Ed,
1
1102
by: Rob T | last post by:
This is just a general question....trying to collect some ideas on how to approach this issue: I have a web app that has users across the country. Since they login, I can make their profiles have a time zone field, so that's no big deal. My data in question is stored in SQL 2000 in a datetime type and the server is set to Eastern time. ...
10
15410
by: David Garamond | last post by:
The Postgres manual says: The AT TIME ZONE construct allows conversions of time stamps to different time zones. I'd guess most people would think what's meant here is something like "unit conversion", and that the timestamp value stays the same (much like 2 feet becomes 24 inches when it's being "converted"). But: # SELECT NOW() =...
4
11838
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
6228
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
14
2629
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...
7
5499
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...
0
7444
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...
0
7711
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. ...
0
7954
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...
0
7805
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...
0
6039
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...
1
5367
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...
0
3497
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...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
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

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.