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


Time Zone


Time Zone

Author
Message
Andre Guerreiro
Andre Guerreiro
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2307 Visits: 1515
Such an easy question that feels refreshing and points out an excellent feature for international dates.

Thank you, Steve, Hugo and Mark for the additional explanations and opinions.

Best regards,

Best regards,

Andre Guerreiro Neto

Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2/MCSE/MCSA
cengland0
cengland0
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2260 Visits: 1300
Call me old fashioned but I would use two columns for this too. The big reason is that I like using portable SQL code and this is new to SQL Server 2008. If I put my code on another company's server and they are using 2005, then it will stop functioning. Why should I subject myself to emergency repairs if I can fix the problem during design time?

I also like writing SQL code that is compatible with Oracle and MySQL. Many of the datetime functions make this difficult but at least I try my best to keep it standardized by using as much ANSI SQL as possible.
mtassin
mtassin
SSCertifiable
SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)

Group: General Forum Members
Points: 7410 Visits: 72521
Oracle supports storing timezone with dates.

http://docs.oracle.com/cd/B14117_01/server.101/b10759/functions179.htm

Using the portability defense really isn't a good idea... each DB server is different enough, that queries that can run on all of them, likely run poorly on all of them.



--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
Revenant
Revenant
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12697 Visits: 5010
I am surprised that only 62 percents of respondents got this one right.

Thanks, Steve!
cengland0
cengland0
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2260 Visits: 1300
mtassin (1/10/2012)
Oracle supports storing timezone with dates.

http://docs.oracle.com/cd/B14117_01/server.101/b10759/functions179.htm

Using the portability defense really isn't a good idea... each DB server is different enough, that queries that can run on all of them, likely run poorly on all of them.

I cannot disagree with this. However, would you rather write 3 or 4 versions of a program or just one? I sell a service and the companies I sell it to have a variety of server implementations.

It might be okay to write 3 versions of the same application but then it becomes a problem with enhancements. You need to enhance all of them at the same time and that triples your workload.
OzYbOi d(-_-)b
OzYbOi d(-_-)b
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1716 Visits: 778
tks Steve
DBA_Dom
DBA_Dom
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1044 Visits: 81110
Nice easy question after a day full of issue, bugs and headaches. Thanks.
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26391 Visits: 12506
SQLRNNR (1/9/2012)
EZ PZ

+1

Tom

Rob Schripsema
Rob Schripsema
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3235 Visits: 11042
A timely question. We're starting to have to deal with lots of time related data coming in from multiple time zones and need to come up with a good strategy for storing/comparing/managing it all. This data type will likely fill the bill for us, so this question is a good start on my research and design. Thanks!

Rob Schripsema
Propack, Inc.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)

Group: Administrators
Points: 150189 Visits: 19449
cengland0 (1/10/2012)
mtassin (1/10/2012)
Oracle supports storing timezone with dates.

http://docs.oracle.com/cd/B14117_01/server.101/b10759/functions179.htm

Using the portability defense really isn't a good idea... each DB server is different enough, that queries that can run on all of them, likely run poorly on all of them.

I cannot disagree with this. However, would you rather write 3 or 4 versions of a program or just one? I sell a service and the companies I sell it to have a variety of server implementations.



If you are a software writer that has multiple targets, I can see your point. However the vast majority of us, 90+% of the developers out there write for applications that are not sold, are internal, and target one platform.

Your comment is valid, but you should qualify it with the note that your job requires this. I have almost never seen anyone port code from one RDBMS to another, outside of an ISV. Even when we've switched platforms, it was a data move, not a code move.

For ISVs, hire more people. Don't write queries that suck on all platforms. Rewrite them for different platforms.

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
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