Skip to content

no-offsetdatetime

Full name
@azure-tools/typespec-azure-core/no-offsetdatetime

Prefer using utcDateTime when representing a datetime unless an offset is necessary. Most Azure services work with UTC times and offsetDateTime adds unnecessary complexity.

As a model property:

model Bar {
prop: offsetDateTime;
}

As an operation return type:

op getTimestamp(): offsetDateTime;

As a union variant:

union TimeValue {
a: offsetDateTime,
}

As a scalar extension:

scalar myDateTime extends offsetDateTime;
model Bar {
prop: utcDateTime;
}
op getTimestamp(): utcDateTime;