Knocking off early

  • Comments posted to this topic are about the item Knocking off early

  • Strangely, I tried the code and it reported a syntax error... the only thing that didn't was the Convert statement, which didn't give the right time. A niggle, I know, but it did imply that the syntax structure was not valid.

  • This actually isn't quite right unless you are living in Arizona.  But I think you live in Colorado.  In that case, the proper time zone is "Mountain Standard Time".  What you have works now, but would not work correctly once back on Daylights Savings.  US Mountain Standard Time is for AZ, which does not observe DST.  Similar case with Eastern Standard Time and US Eastern Standard Time.  The latter is to accommodate for Indiana, which didn't observe DST until about a decade ago.  The time zone functions actually know all this.

    The time zone improvements are one of my favorite 2016 new features.  However, I wish Microsoft in this case would have used "Mountain Time" to represent the DST moving time zone and "Mountain Standard Time" to indicate that it doesn't move.  I find the Mountain Standard Time vs US Mountain Standard Time to be less clear.

    • This reply was modified 4 years, 10 months ago by  RonKyle.
  • technically, I would think that you would work a half day and then knock off, so if you normally start at 8 am your time, you would knock off at 12 pm your time.

    Luther

     

  • latkinson wrote:

    technically, I would think that you would work a half day and then knock off, so if you normally start at 8 am your time, you would knock off at 12 pm your time.

    Luther

    Who's to say Steve doesn't normally start at 1AM? ; )

  • steve.powell 14027 wrote:

    Strangely, I tried the code and it reported a syntax error... the only thing that didn't was the Convert statement, which didn't give the right time. A niggle, I know, but it did imply that the syntax structure was not valid.

    Which version of SQL Server? If not specified you should be looking at the latest or 1 version back (2017/2019)

     

  • RonKyle wrote:

    This actually isn't quite right unless you are living in Arizona.  But I think you live in Colorado.  In that case, the proper time zone is "Mountain Standard Time".  What you have works now, but would not work correctly once back on Daylights Savings.  US Mountain Standard Time is for AZ, which does not observe DST.  Similar case with Eastern Standard Time and US Eastern Standard Time.  The latter is to accommodate for Indiana, which didn't observe DST until about a decade ago.  The time zone functions actually know all this.

    The time zone improvements are one of my favorite 2016 new features.  However, I wish Microsoft in this case would have used "Mountain Time" to represent the DST moving time zone and "Mountain Standard Time" to indicate that it doesn't move.  I find the Mountain Standard Time vs US Mountain Standard Time to be less clear.

    "US Mountain Standard Time" works. And it is always Standard time at Christmas.

    2019-12-24 11_06_50-SQLQuery3.sql - Plato_SQL2016.sandbox (PLATO_Steve (51))_ - Microsoft SQL Server

  • sknox wrote:

    latkinson wrote:

    technically, I would think that you would work a half day and then knock off, so if you normally start at 8 am your time, you would knock off at 12 pm your time.

    Luther

    Who's to say Steve doesn't normally start at 1AM? ; )

    Steve's wife certainly would not find this to be acceptable.I normally start between 7-8, and I'll likely call it an early day.

  • As the question says that you live in Colorado, "Mountain Standard Time" is the best possible answer.  It's right all the time, as opposed to "US Mountain Standard Time", which would not give you the correct answer if you had to determine the time difference in the summer as it's intended to be valid only for Arizona.  Still wish Microsoft had come up with better names (repeated in case someone from MS reads these).

    As you are looking for additional submissions, if you'd like me to write something up on the time zone capabilities, let me know.  I've seen a couple of articles, but not certain if they were in SSC.

Viewing 9 posts - 1 through 8 (of 8 total)

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