Problems converting USA and UK datetimes

  • We are using a CONVERT(char(10), ExpirationDtm, 101) function to remove the time portion from a datetime value.

    This value is then used in a different date function where it needs to be re-converted back to a datetime value.

    The problem that we are seeing is when customers in the U.K., where the date format defaults to DD-MM-YYYY, try to do this they get an error indicating that the datetime value is out-of-range.

    We know this is happening because the month and day values are being reversed, but we have yet to figure out how to avoid it.

    Any suggestions?

    Thanks in advance,

    John Lennox

  • i would recommend you to convert the data in ISO format . Being a international standard it will always give you consistency.

    CONVERT(char(10), ExpirationDtm, 112) .

    i for one always store my date in ISO format.

  • Thanks Nazim,

    I think that may do the trick.

    --John

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply