Solved

.net remoting and SQL Timezones

Posted on 2006-07-06
6
315 Views
Last Modified: 2012-06-27
Hi All,
Could someone point me to a resource that would explain how when .net remoting calls Microsoft SQL for a  time object that is stored in the SQL database (Such as an appointment time).  If the SQL Server is in a different time zone from the user's computer, how does the time object handle this?

Any help would be greatly appreciated.

Scott
0
Comment
Question by:smpross
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:topdog770
Comment Utility
What we typically do to address this issue of different time zones, is store the time values in the database using greenwhich time and then when loading the time in a client app, take the database greenwhich time add the localized timezone offset.

0
 

Author Comment

by:smpross
Comment Utility
Topdog,
Ok, but how do you know the local time zone of the computer?  Also we may have a need for a user to see what time the appointment is in cst even though they are in pst.

Any thoughts?

Scott
0
 
LVL 12

Accepted Solution

by:
topdog770 earned 500 total points
Comment Utility
== Sample project and data ==
http://channel9.msdn.com/ShowPost.aspx?PostID=142586

== Some Basic Info ==
"Coding Best Practices Using DateTime in the .NET Framework"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/datetimecode.asp
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 12

Expert Comment

by:topdog770
Comment Utility
I'd be tempted to create your own time entity that stored the date time in what ever format works best for your overall plans, throw in any conversion steps that you need and additionally store the appointments "time zone of creation" value so that you would be able to say things like this:

Michael created a 1 PM appointment July 06, 2006 PDT.  

for a viewer on the east coast you could display

Michael has a 4PM appointment( 1PM PDT) today, with Frank to discuss...

MyConceptOfATimeObject
{
  // universal time of appt
  // time zone of owner

  // common conversion and format functions
}

0
 

Author Comment

by:smpross
Comment Utility
Topdog,
It is funny that you say that... That is what we originally did, however, what I found was this:
The SQL Server was in EST.
The client was in CST time
The time was stored in the database in GMT.

When the GMT time was requested, the client would perform the conversion to CST.  However, what we found is that a secondary conversion occured that between the SQL server time zone and the Client.

Here is an example:

The appointment time was stored in GMT as 5:00 pm
The client (in CST) performed the conversion to 12:00 pm (- 5 hours for GMT)
It then performed a secondary conversion to 11: am to compensate for the difference between the SQL Server time zone and the client time zone.

Scott
0
 

Author Comment

by:smpross
Comment Utility
BTW, the MS article is just what I needed!  Thanks.

Scott
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now