I'm perplexed about this date formatting using a template

I’m trying to create a timestamped Journal tiddler and I’ve reached this stage:

\define createJournalEntry()
<$action-sendmessage 
  $message="tm-new-tiddler"
  title=<<now "Journal - YYYY-MM-DD-hh-mm-ss">>
  text={{Journal Template}} />
\end

<$button actions=<<createJournalEntry>>>
  Create Journal Entry
</$button>

The only problem is the date and time format. I would like the month and the day to be with a leading zero as appropriate, but I don’t know how to do this.

\procedure createJournalEntry()
<$action-sendmessage 
  $message="tm-new-tiddler"
  title=<<now "Journal - YYYY-0MM-0DD-hh-mm-ss">>
  text={{Journal Template}} />
\end

<$button actions=<<createJournalEntry>>>
  Create Journal Entry
</$button>

try this,and check docs

https://tiddlywiki.com/#DateFormat

1 Like