Jump to content
  • 0

SysDateTime and GetDate Timezone


taylorswiftlover

Question

4 answers to this question

Recommended Posts

  • 0

Hello @taylorswiftlover,

According to the documentaion, SysDateTime() function returns  current system timestamp. More details can be found here:
https://docs.microsoft.com/en-us/sql/t-sql/functions/sysdatetime-transact-sql?view=sql-server-ver15

Also, you can use the following function to get UTC date and time - SYSUTCDATETIME()

To make it more relevant to another timezone you should use Dateadd() function. More details can be found here:

https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?view=sql-server-ver15

Hope it helps.

Link to comment
Share on other sites

  • 0
On 4/1/2020 at 7:09 AM, Alison said:

Hello @taylorswiftlover,

According to the documentaion, SysDateTime() function returns  current system timestamp. More details can be found here:
https://docs.microsoft.com/en-us/sql/t-sql/functions/sysdatetime-transact-sql?view=sql-server-ver15

Also, you can use the following function to get UTC date and time - SYSUTCDATETIME()

To make it more relevant to another timezone you should use Dateadd() function. More details can be found here:

https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?view=sql-server-ver15

Hope it helps.

Thank you @Alison!!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...