Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3242152
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:16:54+00:00 2026-05-17T18:16:54+00:00

On my install of SQL Server if I perform the following SELECT CAST(‘2008-05-03 00:00:00’

  • 0

On my install of SQL Server if I perform the following

SELECT CAST('2008-05-03 00:00:00' AS DATETIME), CAST('2008-05-03T00:00:00' AS DATETIME)

Then I get the following result

2008-03-05 00:00:00.000 2008-05-03 00:00:00.000

Now this is odd in itself as I’m not sure why it’s parsing the first date as yyyy/dd/mm (my login is set to british english btw) and that date format is not a standard one AFAIK.

I’m not sure where to start poking to try to resolve this odd parse issue which doesn’t seem to occur ion any of my colleagues systems.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:16:54+00:00Added an answer on May 17, 2026 at 6:16 pm

    Your first format is indeed a language-dependent format (ODBC canonical), and since your system is defined to be “British English”, it will be interpreted as YYYY-DD-MM (if it’s “American English”, it would be interpreted as YYYY-MM-DD).

    However, the second one is the ISO-8601 standard date format (Wikipedia) that will work on any installation of SQL Server, regardless of your language or locale settings. It’s format is always YYYY-MM-DDTHH:MM:SS and will be interpreted as such.

    Try this:

    SET LANGUAGE british
    
    SELECT 
        CAST('2008-05-03 00:00:00' AS DATETIME) 'UK Date',
        CAST('2008-05-03T00:00:00' AS DATETIME) 'UK ISO Date'
    
    SET LANGUAGE  us_english
    
    SELECT 
        CAST('2008-05-03 00:00:00' AS DATETIME) 'US Date',
        CAST('2008-05-03T00:00:00' AS DATETIME) 'US ISO Date'
    

    My output is:

    UK Date                    UK ISO Date
    2008-03-05 00:00:00.000    2008-05-03 00:00:00.000
    
    US Date                    US ISO Date
    2008-05-03 00:00:00.000    2008-05-03 00:00:00.000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i can't install sql-server 2008 on Windows Server 2003 standard edition SP1 i get
I'm using the following command to install SQL Server Express 2008 R2 on various
Is it possible to install sql server 2005 express and sql server 2008 developer
I am executing the following code to install SQL Server 2012 in silent mode.
I've been trying to install SQL Server 2008 R2 with tools. I've downloaded thisn
i want to install my client an application that uses SQL Server 2008 database.
I want to install SQL Server 2008 express. I have already Visual Studio 2008
anyone have script or procedures to install SQL Server 2008 Express, set up the
I am trying to install SQL Server 2008 and during the pre requisite check
I'm trying to install SQL Server 2008 R2(Express) on Windows Developer Preview (32bit) but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.