Hi Hubert,

Thanks for this, which I'll be able to use down the line but at the moment, 
I wouldn't know how apply this globally.

However, I've managed to find a solution using a text editor like Notepad 
++. Instructions below for anyone else looking for this.

So, to convert 18/09/10 to 2018-09-10

Select 'Regular expression' in Search Mode

'Find what'       ([0-9]{2})/+([0-9]{2})/+([0-9]{2})

'Replace with'  20\1-\2-\3

there's a bit more info. here 
<https://stackoverflow.com/questions/4331138/find-and-replace-with-reordered-date-format-in-notepad>

Thanks
Jon

On Monday, 8 June 2020 16:22:00 UTC+1, Hubert wrote:
>
> Hi Jon,
>
> You can use this ugly macro below to "convert" any string like this: 
> "20/06/07" into this: "2020/06/07", assuming that the earliest year in your 
> range is the year 2000.
>
> Paste this macro definition in a new tiddler:
>
> \define UpdateDate(date)
> <$vars
>    y={{{ [<__date__>split[/]nth[1]add[2000]] }}}
>    m={{{ [<__date__>split[/]nth[2]] }}}
>    d={{{ [<__date__>split[/]nth[3]] }}}>
> <<y>>/<<m>>/<<d>>
> </$vars>
> \end
>
> And then below that, put your input dates in the macro like this:
>
> <<UpdateDate 20/06/07>>
>
> When you save the tiddler the output will be rendered to this: 2020/06/07
>
> You can wrap this macro in a filter to change all dates in one go and then 
> simply copy/paste the output.
>
> The whole operation would probably be quicker and simpler using a text 
> editor as these are just strings, not to mention that the above macro can 
> probably be simplified to a one-liner. Anyway, just something quick.
>
> Regards,
> Hubert
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2fb17d71-90e7-4b33-aaaa-37c81a59e883o%40googlegroups.com.

Reply via email to