473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1933

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

Similar topics

6
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...
2
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
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
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....
1
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...
5
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...
4
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...
8
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.