Modify "created" and "modified" by a certain date

Hello,
need help to modify “created” and “modified” of current tiddler with content of customer field “published”.
Dateformat of published: YYYY.MM.DD

Update should be manual triggered with a click to a button in current tiddler:

Thanks
Stefan

Stephan,

I am curious why you would do this?, because you make a lie of the fieldnames created and modified. Anyway, modified may be changed immediately, or soon after by any change.

It would be better to add the handling of published elsewhere rather than change the way “core fields” values are changed.

  • It would also have being better to set published to the full date/time stamp in the first place eg published=<<now YYY0MM0DD0hh0mm0ss0XXX>>

Never the less to convert the “published” field YYYY.MM.DD to a Tiddlywiki date stamp of YYY0MM0DD0hh0mm0ss0XXX is needed.

  • You have to add the time component, so a Good value is 12 noon “120000000”
  • this will work;
<$set name=input-date value="2022.12.01">

{{{ [<input-date>split[.]] [[120000000]] +[join[]] }}}

</$set>

or in your example

  • {{{ [{!!published}split[.]] [[120000000]] +[join[]] }}}

Is this enough for you to move forward?

“published” can be a date in the future - but I will think about…

Thanks for your feedback.
Stefan

1 Like