Answer simple quiz at the end of the blog post and –
Every day one winner from India will get Joes 2 Pros Volume 3.
Every day one winner from United States will get Joes 2 Pros Volume 3.
System and Time Data Types
Keeping track of date and time data points has always been a critical part of online transactional databases. For example, each sales invoice record needs a date-time stamp, as do systems which track quotes and customer contacts regarding sales opportunities.
Think of how many times during your workday that you rely on a date-time stamp as helpful metadata to sort or locate the latest information in a report or data source. Global organizations, in particular, have a need for their in-house communication, reporting, and collaboration tools to appropriately convey accurate date and time information in order to keep every part of the organization in sync.
Recap of DateTime Functions
GETDATE( ) and SELECT SYSDATETIME( ) both return the current date and time in your time zone. However, GETDATE( ) shows fractional seconds expressed in milliseconds (.333 second), and SYSDATETIME( ) shows fractional seconds expressed in nanoseconds (.3333333 second). SYSDATETIME( ) return similar results but their precisions differ.
What time is it right now in the UK? UTC is Coordinated Universal Time, formerly known as Greenwich Mean Time (GMT). (UTC is also known by the terms zulu time, world time, and universal time.)
SELECT GETUTCDATE( ) will show the current time expressed in terms of UTC. GETUTCDATE( ) is less precise than SYSUTCDATETIME ( ). However there is a UTC function that gets down to the nanoseconds, SYSUTCDATETIME( ). When we run all 4 of these functions together We see the two top times in my local time zone (in my case the Pacific time zone) and the two bottom times in UTC.
Question 16
Which one of the following functions will return the date and time in the current time zone to a precision of milliseconds?
- GETDATE( )
- SYSDATETIME( )
- GETUTCDATE( )
- SYSUTCDATETIME( )
Rules:
Please leave your answer in comment section below with correct option, explanation and your country of resident.
Every day one winner will be announced from United States.
Every day one winner will be announced from India.
A valid answer must contain country of residence of answerer.
Please check my facebook page for winners name and correct answer.
Winner from United States will get Joes 2 Pros Volume 3.
Winner from India will get Joes 2 Pros Volume 3.
The contest is open till next blog post shows up at which is next day GTM+2.5.
Reference:Â Pinal Dave (https://blog.sqlauthority.com)
100 Comments. Leave new
Correct Answer is Option 1
Explanation:
1)GETDATE() returns date time in miliseconds.
Example:
SELECT GETDATE()
Thanks
Vishal Patwardhan
Indore(India)
hello,
correct answer is option #1 i.e: getdate()
getdate(): it will return the date and time in the current time zone to a precision of milliseconds
sysdatetime(): nano seconds
azaad mohammed
from mumbai,india
The correct answer is 1.GetDate()
Correct Answer: Option 1
GETDATE() returns date time in miliseconds.
Romania
Correct answer is Option #1
1.GETDATE()
Pritesh Mehat
India
Correct answer is Option #1
1.GETDATE()
Pritesh Mehta
India
Correct Answer:
1) GETDATE()
Thanks,
Mandar
Mumbai, INDIA
Correct Answer: GetDate() option 1
Purna from INDIA
Hi Pinal,
The answer for the above question is Option 1) GETDATE( ).
Explanation:
Asked : Function will return the date and time in the current time zone to a precision of milliseconds.
Explanation : Here we need to find out Current time zone in the above article it is very beautifully explained by pinal sir that GETDATE() will return current date and time in your time zone by default your time zine is said as default time zone though GETUTCDATE( ) returns the same in milliseconds but here our requirement is current time zone, i.e our zone.
Apart from that no other option will give us that result.
Diljeet kumari
Country : India
Correct option is #1
SYSDATETIME() returns current time zone datetime upto nanoseconds which is not required.
INDIA
Correct Answer:
1. GETDATE()
GETDATE() will return current date and time in current time zone with precision of milliseconds.
Hiren Bavishi
India
Correct Answer is Option 1
Explanation: Option 3 and 4 provide date and time in Universal Time Coordinates (UTC) and option 2 provide date and time in current time zone but with precision of nanoseconds.
Option 1 provide date and time in current time zone to a precision of milliseconds.
Country – INDIA (Gujarat)
Option 1 is correct
Mangesh From India
Option 2. SYSDATETIME( ), will return the date and time in the current time zone to a precision of milliseconds.
(Sale, Nigeria)
Option 1 is correct
Country : India
option #1 GETDATE( ) is correct as it the date and time in the current time zone to a precision of milliseconds
Question No:16
Answer : GETDATE() — Option 1
Shalini Meyyappan
Chennai India.
Correct Answer is option No : 1 ) GETDATE( )
GETDATE( ) returns current time zone details with milliseconds precision.
Shekhar Gurav
Country : INDIA
The correct answer is option 1 :
1. GETDATE( )
It shows fractional seconds expressed in milliseconds.
Deepali Bhende.
Country : INDIA
Correct Option is 1
GETDATE() which gives date and time and the precision to milliseconds.
Regards
Rajesh
From India