Thanks for reaching out to Microsoft Q&A
The time zone of a dedicated SQL pool in Azure Synapse Analytics cannot be changed. The dedicated SQL pool uses the time zone of the Azure region it's deployed in, which in your case is likely UTC. This means that the GETDATE() function will always return the time in UTC.
Here are two ways to adjust the datetime returned by GETDATE() to Italian time:
- Use the AT TIME ZONE clause: You can add the AT TIME ZONE clause to the GETDATE() function to specify the desired time zone. For example, the following query would return the current time in Italian time:
SELECT GETDATE() AT TIME ZONE 'Central European Time' AS ItalianTime;
- Convert the UTC time to Italian time after it is returned by GETDATE(): You can use the DATEADD function to convert the UTC time to Italian time. For example, the following query would add two hours to the current UTC time to get the current Italian time:
SELECT DATEADD(HOUR, 2, GETDATE()) AS ItalianTime;
The query in the image you sent uses both methods to achieve the same result. The first three columns all return the same value, which is the current time in UTC. The fourth column uses the AT TIME ZONE clause to convert the UTC time to Central European Time.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.