no-offsetdatetime
@azure-tools/typespec-azure-core/no-offsetdatetimePrefer using utcDateTime when representing a datetime unless an offset is necessary. Most Azure services work with UTC times and offsetDateTime adds unnecessary complexity.
โ Incorrect
Section titled โโ Incorrectโ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;โ Correct
Section titled โโ Correctโmodel Bar { prop: utcDateTime;}op getTimestamp(): utcDateTime;