I don’t think that’s possible, it would be a violation of function purity. But you can avoid the extra file by passing the value as a command-line parameter:
That’s more to type (not a problem with command line recall or watch and can’t be done (easily) in Sublime Text. The extra file itself is not the issue, I can run make which I can fire up under ST.
I was wondering if there are plans of supporting finer grained date/time in typst itself, ie down to the second.
Using the current timestamp as the document’s date invalidates a lot of previously compiled stuff. Since Typst uses incremental compilation to achieve its speed, this would increase compile times for reasons that users could not easily understand and identify, leading to frustration.
With instant preview, it’s not obvious whether the passage of time should update the preview or whether only changes in the document should. Both ways feel “off” in some ways, and the former way leads to unnecessary recompilations.
One of the use cases cited is to change document appearance based on the time of day (switching between light/dark mode). This in particular would be better served by support from the editor, since here you’re only interested in the preview’s appearance, not the finished document.
A propos finished document: to me personally it always felt wrong to give work-in-progress documents a timestamp to indicate when it was “finished” – and once a document is finished, the last time I saved the document doesn’t really change the timestamp. So I always preferred manual timestamps anyway, admittedly not at second granularity because it wasn’t important to me. (Also admittedly, this preference may be a holdover from WYSIWYG word processors where it was never super transparent to me when these fields would and wouldn’t get updated, which doesn’t apply to Typst.)