|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 1:57 PM
Points: 2,575,
Visits: 1,533
|
|
| Nice question, even better discussion. Thanks all!
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 1:02 AM
Points: 10,989,
Visits: 10,534
|
|
marlon.seton (5/8/2012) What I find more disturbing than this reliance on implicit conversion and thinking of a DATETIME value being held as a float is the reference to 12.00 AM. Surely everyone knows midnight and noon are neither PM nor AM. This article sums the situation up quite well: http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight
Even if we take the position that AM and PM, taken literally from their meanings in Latin, do not apply to midnight and noon, there are still certain practicalities to consider. For example, certain CONVERT styles specify AM and PM. By convention, we set midnight as AM and noon as PM:
SELECT CONVERT(char(26), CONVERT(datetime, '2012-07-11 00:00:00', 120), 109); SELECT CONVERT(char(26), CONVERT(datetime, '2012-07-11 12:00:00', 120), 109);
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Today @ 3:59 AM
Points: 1,689,
Visits: 655
|
|
The sooner we stop using datetime the better. We now have Date & Time Data Types and DateTime2.
It's fairly straight forward: Dates and Times should be stored as such. If a Timestamp is required then use Datetime2 with its correct level of accuracy.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 9:43 AM
Points: 469,
Visits: 193
|
|
| Easy and straight forward one. Thanks
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, October 24, 2012 8:17 PM
Points: 1,558,
Visits: 247
|
|
Good question. Thanks for submitting.
http://brittcluff.blogspot.com/
|
|
|
|