MssqlClock class
Which server clock the runtime uses for timestamp columns.
SQL Server offers both: SYSUTCDATETIME() returns UTC, SYSDATETIME()
returns the server's local time, and SYSDATETIMEOFFSET() carries the
offset. A datetime2 column has no offset of its own, so the choice of
clock is the choice of timezone for every stamped row — and mixing two
clocks makes a deleted_at comparison between two rows meaningless.
The default is serverUtc: a single, unambiguous clock. serverLocal is an explicit opt-in for applications whose server timezone is fixed and whose existing data is already in local time.
- Annotations
-
- @immutable
Properties
- expression → MssqlExpression
-
The SQL expression to write into a
SETorVALUESclause.no setter - hashCode → int
-
The hash code for this object.
no setteroverride
- isUtc → bool
-
Whether this clock is UTC.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- serverLocal → const MssqlClock
-
The server's local clock:
SYSDATETIME(). - serverUtc → const MssqlClock
-
The server's UTC clock:
SYSUTCDATETIME().