Merk
Tilgang til denne siden krever autorisasjon. Du kan prøve å logge på eller endre kataloger.
Tilgang til denne siden krever autorisasjon. Du kan prøve å endre kataloger.
Applies to:
SQL Server 2022 (16.x) and later versions
Azure SQL Database
Azure SQL Managed Instance
SQL database in Microsoft Fabric
This function returns the name of the time zone observed by a server or an instance. For SQL Managed Instance, return value is based on the time zone of the instance itself assigned during instance creation, not the time zone of the underlying operating system.
Note
For SQL Database, the time zone is always set to UTC and CURRENT_TIMEZONE returns the name of the UTC time zone.
Syntax
CURRENT_TIMEZONE ( )
Arguments
This function takes no arguments.
Return Type
varchar
Remarks
CURRENT_TIMEZONE is a non-deterministic function. Views and expressions that reference this column cannot be indexed.
Example
Note that the value returned will reflect the actual time zone and language settings of the server or the instance.
SELECT CURRENT_TIMEZONE();
/* Returned:
(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
*/