Jump to content
  • 0

SysDateTime and GetDate Timezone


Question

2 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 post
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 post
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...