473,626 Members | 3,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Reliable Way To Convert DateTime Values from UTC to CST and Back

Bruce wrote:
Storing everything in UTC still would not solve my probems. It isn't a
viable option because we have to maintain backward compatability with
previous versions of the application.
Sure, hence my "easy to say after the fact" remark. Once you've got it
wrong, you're usually stuck with it.
The real issue is that dates should be stored as dates, not as date
time, unless there is a specific need for both such as in a time stamp.
But if that's the only problem, isn't it trivial for you to just ignore the
time part?
When a date is entered as 10/16/2008 it needs to be displayed as that
regardless of the time zone.
Per above, what's stopping you from doing that? All you need to do is force
the .Kind of the DateTime to UTC after reading it from the DB (it should be
Unknown initialy). It isn't UTC, but that doesn't matter -- what matters is
that no time zone offsets are applied.

You will not be able to reliably tell what the date was in any other time
zone (that's just not possible without the time), but a date is a date.

--
J.
Oct 16 '08 #1
0 1947

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

Similar topics

6
24793
by: Thomas Bartkus | last post by:
MySQL Version 4.0.20 on a Linux server. How does one get the elapsed time between (2) DateTime values? I need the answer to the nearest minute. Is upgrading to Ver 5 with its more robust date/time functions the only solution? You can directly subtract 2 DateTime values and a long integer results. What is that number?
2
7964
by: Jelena via SQLMonster.com | last post by:
Does anybody can help me to convert datetime value let's '1936-04-13 07:00:00.000' to DATE as '04/13/1936'. I need this value in the Excell as a DATE format. Thanks in advance
2
4782
by: ziggislaw | last post by:
hello how can I convert DateTime from "25.12.2005" to "2005-12-25 00:00:00.000" ? Now I have DateTime as string (I get it from <asp:label>). Thanks
2
20486
by: deepbright | last post by:
I'm having trouble understanding the MySQL docs on how to subtract two DATETIME values. I have two tables that have a DATETIME column. In my SELECT I am doing a JOIN to bring in both sets of rows. What I want is to subtract the DATETIME values to determine the number of seconds between their time. In the WHERE clause I also want to filter the selected rows if the difference in the DATETIME values is less that 900 (seconds). Any help?
1
2038
by: jimmybaba | last post by:
hi all i am newly graduate and started my first job.......i am geting problem to convert datetime into date only , i am trying to get values from sqlserver table with comparison of date. i am using c# what i am doing is: switch (completed) { case 0 : if(date<DateTime.Today) e.Cell.Text += "<tr><td style=\"font-size:8px;color:red;line-height:12px;vertical-align:center;\">"; ...
5
3615
by: Angus | last post by:
Hello I have an unsigned char and I want to convert the individual array values into hex and copy to a std::string. The array does not always hold 14 values - but I do know the length of the data - obviously up to 14 chars. An example is an array of six items with decimal values: 0, 10, 228, 164, 72, 11. I want to convert these values to hex and copy to a
4
1516
by: gotonagle | last post by:
hi , i m new to asp and leraning it... i have only one page in which i take some values like name, dob and education degree. after post back i return to this page iteslf.. but the values in dropdown list is not tha what i hadve selected(coz it do not support viewstates). is there any method to retrive the values back in drop down. for text i m usoing like this. <tr> <td align="right" > Name : </td> <td><input type=text...
8
2302
by: puzzlecracker | last post by:
Is it possible, in a clean way, to convert int values too bool int i=10; bool b=(bool)i; instead of doing b=(i>0);
1
8270
by: remya1000 | last post by:
I’m using VB.net 2003 application program. I am trying to do a select statement whereby I'm searching between 2 datetime values that are being stored as datetime. records are stored inside Access. For example, I’m searching between 2 datetime So I need to find all the records in between 10:00 AM and 12:30 AM on 2/23/2009. i tried this code
0
8199
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,...
0
8638
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...
0
7196
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
6125
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
5574
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();...
0
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2626
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
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
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.