Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DateTime regardless of time zone in SQL Server 2005

Posted on 2007-03-28
3
Medium Priority
?
2,332 Views
Last Modified: 2008-01-09
Say I was born on June 1st, 2000. If anybody asked me, in any part of the world, when I was born I would say June 1st, 2000. I wouldn't say something like "Well, Im in Fiji now and I was born in Canada, so adjusted for time zone differecne I was born on June 2, 2000" or something like that.

Is there any way in SQL Sever 2005 to specify DateTime that is the same for all time zones? If not, in C#, is there any easy way to play around with DateTime object to achieve the functionality?

Thanks!
0
Comment
Question by:krupini
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 18811465
you will get the GMT time using  GetUTCDate()
0
 

Author Comment

by:krupini
ID: 18811669
Say I have a SimpleTable:

Name      BirthDate
Alex        2000-01-01
Tom        2000-01-02

In my C# code, when I call "SELECT * FROM SimpleTable" and populate the dataset, and then access the dates, the dates will be adjusted for time zone. So where exactly should I call GetUTCDate() ?
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 18811850
when u store the Birthday, store the GMT Datetime in the filed. and while retriving, you can compare the value with GetUTCDate() to give you the exact difference
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

670 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