SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Moving to a time zone offset


Moving to a time zone offset

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)

Group: Administrators
Points: 250114 Visits: 19813
Comments posted to this topic are about the item Moving to a time zone offset

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27471 Visits: 7549
Interesting question - i think this will come in handy as our business expands across time zomes

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
HappyGeek
HappyGeek
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4962 Visits: 2674
Very good question, wasn't confident in the answer but learned something in the process. Thanks Steve.

...
Steve Jones
Steve Jones
SSC Guru
SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)SSC Guru (250K reputation)

Group: Administrators
Points: 250114 Visits: 19813
I thought this was interesting as well. I learned something researching.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Tom Thomson
Tom Thomson
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39641 Visits: 12889
Good question on TODATETIMEOFFSET (but I prefer to write, for example, "330" instead of "'+05:30'").

I tend to wonder about "ensure all my time values are consistent and comparable". Will using datetimeoffset achieve that when the local time difference between two places will change somewhere between never and four times a year? For example Wellingon NZ was 12 hours ahead of London UK until a few weeks ago, then on 29 Sept it became 13 hours, and on 29 Oct it will become 14 hours, and then on 25 March next year it will become 13 hours again until 1st April when it reverts 12 hours. This is because most local times change their time zone (and hence their time zone offset) twice every year, and the time at which this happens is not co-ordinanted between different localities. Also, just knowing the country is not enough to determine which standard time zone and which adjusted time zones are used (and when the are adopted/dropped) - it's rather obvious for very big countries with a large east-west spread like the USA and Russia multiple zones are needed, but it also applies to smaller countries like Spain ( Las Palmas uses WET and WEST - same as London and Lisbon - while Madrid uses CET and CEST - imposed by Franco to fit with Berlin) and New Zealand (Port Hutt uses time zones 45 minutes ahead of Wellington).

It seems to me that to achieve the stated objectives the code which logs things and their times has to know, every time it logs something, what its local time zone offset for that something at the time it happened so that it can apply the appropriate offset, and is getting that parameter value is a bit more work that just calling TODATETIMEOFFSET.

Tom

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search