Find todays date & time in SQL Server part 2 — Parv The IT Geek

Have you ever wanted to return the time found in GETDATE or CURRENT_TIMESTAMP to a higher level off accuracy in SQL? Well I am going to show you how.

The other day I needed to get the current time to greater accuracy due to the time stamp given to some records and I had to use the following functions which give the time to the millisecond.

SELECT SYSDATETIME () — System time and date

SELECT SYSDATETIMEOFFSET () — The time is included.

SELECT SYSUTCDATETIME () — The date and time is returned as UTC time


Originally published at https://parvtheitgeek.com on February 9, 2014.

Published by Parvinder Nijjar

I blog at ParvTheITGeek.com

Leave a comment