SQL Flow Field Guide

SYSDATETIME

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

nondeterministic time source

What changes

Input
system clock or time zone of the server
Output or change
current date/time value
Return type
datetime2(7)

Syntax at a glance

SYSDATETIME ( )

Work example

Read the current SQL Server host local time at datetime2 precision.

Test month end, leap day, offset, and the session language that will run the query.

Check your work Keep the local-zone contract explicit because datetime2 has no offset.

Open Microsoft Learn for full syntax, permissions, and details for your version.