Adding the time zone

  • Comments posted to this topic are about the item Adding the time zone

  • Technically, none of the choices are correct.  Datetimeoffset is 34 characters in length.  The length of @C truncates the value returned and results in "2018-09-03 11:55:34."  Changing the length of @C to 34 results in the full datetimeoffset string.

  • Nice question to start the week on, thanks Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Robert Eder - Saturday, September 29, 2018 6:57 PM

    Technically, none of the choices are correct.  Datetimeoffset is 34 characters in length.  The length of @C truncates the value returned and results in "2018-09-03 11:55:34."  Changing the length of @C to 34 results in the full datetimeoffset string.

    Exactly.  Does no-one ever actually test these things?

  • Hi @steve-2
    I think none of the answers are correct.
    The varchar size given is 20 and thus it shows only up to "2018-09-03 11:55:34."  in the Result set.
    If it was given like varchar(34) then the answer would be "2018-09-03 11:55:34.0000000 -07:00"

    Thanks

  • Also, the explanation says:

    "The conversion takes place correctly and '2018-09-03 04:55:34.0000000 -07:00' is returned."

  • Robert Eder - Saturday, September 29, 2018 6:57 PM

    Technically, none of the choices are correct.  Datetimeoffset is 34 characters in length.  The length of @C truncates the value returned and results in "2018-09-03 11:55:34."  Changing the length of @C to 34 results in the full datetimeoffset string.

    +1

    ---------------------------------------------------------------------------------------
    The more you know, the more you know that you dont know

  • Shayn Thomas - Monday, October 1, 2018 6:42 AM

    Robert Eder - Saturday, September 29, 2018 6:57 PM

    Technically, none of the choices are correct.  Datetimeoffset is 34 characters in length.  The length of @C truncates the value returned and results in "2018-09-03 11:55:34."  Changing the length of @C to 34 results in the full datetimeoffset string.

    +1

    +Another

  • Question corrected.

  • Explanation is still wrong 🙂

  • What's wrong with the explanation? If I run the changed code, it returns this:

  • Correct answer is:
    '2018-09-03 11:55:34.0000000 -07:00' is returned

    but explanation says:
    The conversion takes place correctly and '2018-09-03 04:55:34.0000000 -07:00' is returned.

  • Fixed

  • Elementary, Dear Watson.  Thanks, Steve!

Viewing 14 posts - 1 through 13 (of 13 total)

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