I need to format my dates in sql server to the following format.
2010-09-09T23:59:00+0000
Any ideas how to achieve date time format using an SQL query?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CONVERTwill get you most of the way:The only thing this won’t give you is the timezone (because neither
datetimenordatetime2hold any timezone information). You’ll need to append this manuall – if you need any other timezone other than UTC, then you’ll need to store this in a separate field in your schema. See the MSDN for more on CONVERT.