Date/time formatting

I like that I can pre-populate a date field in a note with today’s date via the collection (or class) template, but I’m struggling to see how to format it instead as a date-time. The most likely syntax I could think of for the template is:

Date: today("yyyy-mm-dd HH:mm")

but that just gives me yyyy-mm-dd without the HH:mm.

I’ve also tried other variations, such as these:

Date: yyyy-mm-dd HH:mm
Date: <today "yyyy-mm-dd HH:mm">
Date: today&yyyy-MM-dd HH:mm

but nothing seems to do the trick.

If anyone else does this, could you share the magic incantation? Thank you!

Can you give me a bit more context in terms of your use case here? There are System Assigned Dates and Times available, if that’s what you’re interested in.

Sure, and thank you for asking!

The system-assigned dates aren’t ideal, because they aren’t editable and their formats include the offset from UTC and they don’t show up in standard (non-streamlined reading).

I’d prefer a generic date (date-time) field that is overrideable but that will by default be pre-populated with the current date and time in the ISO 8601 format that one can get manually with the first Paste Date… option:

Screenshot 2023-07-23 at 12.38.30

I can of course do this manually, but I’d like the value to already be present, since 98% of the time I wouldn’t need/want to override it.

I hope that’s clearer!

Try out the new beta, and use the value of now instead of today, and let me know how that works out for you.

1 Like