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


Basic Date Function


Basic Date Function

Author
Message
Anipaul
Anipaul
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13903 Visits: 1407
Comments posted to this topic are about the item Basic Date Function



davoscollective
davoscollective
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3299 Visits: 1008
Your computer shows the following system date and time:


If my computer showed that time I would be concerned that it's in US format and not Australian (UK) format! w00t

And none of those functions would show a time 5 hours and 30 minutes earlier on my computer, because I am in Sydney and it's currently UTC+11 here during daylight savings, and UTC+10 the rest of the year. :-P

If I were in the Indian Standard Timezone (UTC+0530) then sysutcdatetime() function would be the answer.

Interesting question, I guess if you had mentioned your timezone in the question it might have made the time component more obvious and the question too easy.
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32768 Visits: 7658
Interesting question.
I do, however, agree with davoscollective regarding the time zone difference.
given that I am in South Africa, which is +2:00, the difference would only be approx 2 hours, and not the 5 1/2 hours reflected in the question...

However, it was a good question in that it made me think very carefully about the given answers.

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Michael Riemer
Michael Riemer
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3543 Visits: 678
+1 to the above points.

Great question as far as idea and content goes, but needs clarification as to where you are in the world!!
Stuart Davies
Stuart Davies
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10620 Visits: 4864
Got it wrong - but only due to the reasons listed above - interesting points raised though

-------------------------------Posting Data Etiquette - Jeff Moden Smart way to ask a questionThere are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (133K reputation)SSC Guru (133K reputation)SSC Guru (133K reputation)SSC Guru (133K reputation)SSC Guru (133K reputation)SSC Guru (133K reputation)SSC Guru (133K reputation)SSC Guru (133K reputation)

Group: General Forum Members
Points: 133330 Visits: 13347
This question could've been better if the question asker realized there are more than one countries in the world.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Hugo Kornelis
Hugo Kornelis
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32026 Visits: 12976
I had almost missed the different time in the returned output, as I was focusing completely on the data type. Caught is just in time!

I do not agree with some of the comments here that time zone of the computer was required to answer this. Once I saw that the time portion of the result was not the same as the listed system time, there was only one option left anyway.


Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
crmitchell
crmitchell
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2215 Visits: 1957
If my computer was displaying that as the system date and time I'd be complaining that GP had messed up the language /country settings. Wrong time and a non existant date.

The difference between local time (GMT) and UTC is negligible and for most practical purposes may be ignored.

As a result none of the answers would give the value requested.
DugyC
DugyC
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2200 Visits: 779
Hugo Kornelis (2/13/2013)
I had almost missed the different time in the returned output, as I was focusing completely on the data type. Caught is just in time!

I do not agree with some of the comments here that time zone of the computer was required to answer this. Once I saw that the time portion of the result was not the same as the listed system time, there was only one option left anyway.

+1

_____________________________________________________________________
"The difficult tasks we do immediately, the impossible takes a little longer"
(Bob Brown)
(Bob Brown)
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1361 Visits: 1145
Thanks. I liked this question. The half hour almost threw me off but I think there could only be one possible answer.
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