May 17, 2012 at 9:25 am
mtassin (5/17/2012)
Lynn Pettis (5/17/2012)
To convert a string version of an IS-8601 date string, two things need to be true. One, you have to have the complete date-time string (tried it with your shorter version, didn't work). Two, you need to use the CONVERT function with the appropriate date format code.
DECLARE @dt1 DATETIME;
SET @dt1 = CONVERT(DATETIME, '2012-05-16T18:11:00.000Z', 127);
SELECT @dt1;
Thanks Lynn, I was just using the first format I saw on wikipedia that included both dates and times fro ISO 8601.
I still stand by the statement that throwing ISO standards at the average person begging for help here is way overboard.
What they typically see when looking at Microsoft SQL Datetimes is "YYYY-MM-DD HH:MM:SS.nnn" Providing date time values in this format seems to be the simplist approach. And what I'd hope they'd give us. 🙂
I still stand by the statement that throwing ISO standards at the average person begging for help here is way overboard.
You'll get no argument from me on this point at all. It doesn't help, especially since the only way you can get these standards is to pay for them. Perhaps Mr. Celko would be willing to purchase a complete set of the ISO Standards for each memebr of SQLServerCentral?
I mean, any one who is willing to pay almost $1,000 for a pair of shoes can afford it. 😉
May 17, 2012 at 9:42 am
Lynn Pettis (5/17/2012)
mtassin (5/17/2012)
Lynn Pettis (5/17/2012)
To convert a string version of an IS-8601 date string, two things need to be true. One, you have to have the complete date-time string (tried it with your shorter version, didn't work). Two, you need to use the CONVERT function with the appropriate date format code.
DECLARE @dt1 DATETIME;
SET @dt1 = CONVERT(DATETIME, '2012-05-16T18:11:00.000Z', 127);
SELECT @dt1;
Thanks Lynn, I was just using the first format I saw on wikipedia that included both dates and times fro ISO 8601.
I still stand by the statement that throwing ISO standards at the average person begging for help here is way overboard.
What they typically see when looking at Microsoft SQL Datetimes is "YYYY-MM-DD HH:MM:SS.nnn" Providing date time values in this format seems to be the simplist approach. And what I'd hope they'd give us. 🙂
I still stand by the statement that throwing ISO standards at the average person begging for help here is way overboard.
You'll get no argument from me on this point at all. It doesn't help, especially since the only way you can get these standards is to pay for them. Perhaps Mr. Celko would be willing to purchase a complete set of the ISO Standards for each memebr of SQLServerCentral?
I mean, any one who is willing to pay almost $1,000 for a pair of shoes can afford it. 😉
Found the PDF for 8601 and 11179 PDF using Bing (might get round to reading these so I can be a pompous doofas as well).
8601: http://dotat.at/tmp/ISO_8601-2004_E.pdf
11179: http://en.wikipedia.org/wiki/ISO/IEC_11179 (use the references at the end and agree the licence [English and Francais available])
Fitz
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply