Skip to content

Conversation

@coopbri
Copy link
Contributor

@coopbri coopbri commented Jan 6, 2026

Based on discussion with @bterlson in Discord

  • Added now() initializer to date/time scalars (plainDate, plainTime, utcDateTime, offsetDateTime)
  • Added correspondent tests

I noticed explicit docs were missing for the date/time initializers (though referenced in a couple other places in the docs), so I added a section for those.

@coopbri
Copy link
Contributor Author

coopbri commented Jan 6, 2026

@microsoft-github-policy-service agree

Copy link
Member

@timotheeguerin timotheeguerin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - feature ✏️

Add now() initializer to date/time scalars (plainDate, plainTime, utcDateTime, offsetDateTime) for indicating current date/time at runtime. Emitters should interpret this as the appropriate runtime value (e.g., database CURRENT_TIMESTAMP, JavaScript Date.now(), etc.).

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 6, 2026

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/compiler@9295

commit: d824e8e

@timotheeguerin timotheeguerin added this pull request to the merge queue Jan 6, 2026
Merged via the queue into microsoft:main with commit 004bbfb Jan 6, 2026
23 checks passed
@coopbri coopbri deleted the feature/timestamp-now branch January 10, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:core Issues for @typespec/compiler meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants