[TW5] Timestamp

1,443 views
Skip to first unread message

Bob Flandard

unread,
Nov 18, 2016, 5:00:04 AM11/18/16
to TiddlyWiki
Hello,

Is there a method to insert the current date and time into a tiddler (in the main text) and for it to remain fixed forever?

I tried the <<now>> macro but it refreshes on editing the tiddler (not sure what that's useful for except as a clock)

Typically a single tiddler may have several instances of the time string.

Thanks, Bob

Jed Carty

unread,
Nov 18, 2016, 5:18:11 AM11/18/16
to TiddlyWiki
It isn't exactly the same and there may be problems with it but the simplest way is probably to use the value in the modified or created field.

You can just put {{!!created}} or {{!!modified}} and it will show the full date and time, or if you want to specify a format you can use the view widget and give the format like this:

<$view field='created' format=date template='0DD MMM YYYY, hh:0mm:0ss'/>


Bob Flandard

unread,
Nov 18, 2016, 7:15:22 AM11/18/16
to TiddlyWiki
Hi Jed,

Thanks for the suggestion, I probably didn't explain properly but neither of these give a permanent time-stamp. The "created" field is fixed and the "modified" field will change on edit. I'm just looking for a shortcut to insert the current time and date (now) into the main text without having to look at a clock and calendar and type the formatted data manually. There may be any number of these (unique) time-stamps in a tiddler and they need to be perpetual.

Regards, Bob

Sylvain Naudin

unread,
Nov 18, 2016, 10:31:50 AM11/18/16
to TiddlyWiki
Hi,

Have a look on this post :

[TW5] Macro for saving timestamp in field – problem https://groups.google.com/d/msg/tiddlywiki/rBFMyGenP5k/GBuZEoWzAwAJ


Cheers,
Sylvain

Bob Flandard

unread,
Nov 18, 2016, 10:41:00 AM11/18/16
to TiddlyWiki
Hi Sylvain,

I saw that post before I posted, but it just adds a field to the tiddler, which is not what I desire.

Regards, Bob

Mark S.

unread,
Nov 18, 2016, 10:41:09 AM11/18/16
to TiddlyWiki
There's not a shortcut key like you might see in other apps.

What you could do is put a now somewhere convenient like in the sidebar (e.g. 

<<now "YYYY-MM-DD hh:mm sss">>)  and then copy and paste the date as you needed.


Good luck,

Mark

Riz

unread,
Nov 18, 2016, 12:24:34 PM11/18/16
to TiddlyWiki


Are you looking for a solution like this? (See attached JSON). Basically it gives you a button in your editor toolbar to insert current time to your text.
Current Time.json

Mark S.

unread,
Nov 18, 2016, 12:59:14 PM11/18/16
to TiddlyWiki
Well drat -- I just learned to make buttons 10 minutes ago, and was about to put my new found knowledge to work ;-)

The main thing I could add, is that if the datestamp is something you use all the time, you could steal one of the short-cut sequences from the other lesser-used buttons and apply it to the new code (e.g. when was the last time you needed a level 6 header?) . Cut the text out of the existing shortcuts field in a shadow tiddler (e.g. $:/core/ui/EditorToolbar/heading-6) and then replace it in the shortcut field in Riz's ($:/core/ui/EditorToolbar/Time)  tiddler. Then you could use Ctl-6 to place your date stamp.

Mark

Bob Flandard

unread,
Nov 18, 2016, 1:08:46 PM11/18/16
to TiddlyWiki
Hi Riz,

Thanks very much, that worked perfectly and is rather elegant too. Your work here is done!

Regards, Bob

Bob Flandard

unread,
Nov 18, 2016, 1:12:31 PM11/18/16
to TiddlyWiki
Hi Mark,

I'm not sure what you're suggesting here as Riz's solution came with its own button, so no need to hijack another (unless I'm missing some subtle point, which is possible). Thanks for your help.

Regards, Bob

Mark S.

unread,
Nov 18, 2016, 2:35:29 PM11/18/16
to TiddlyWiki
I'm was talking about key strokes, so you wouldn't have to click on the buttons. Some people like to keep their hands on the keyboard as they work rather than interrupting to click on this or that.

Have fun,
Mark

Bob Flandard

unread,
Nov 18, 2016, 4:32:30 PM11/18/16
to TiddlyWiki
Hi Mark,

I'd missed that. I don't have the spare storage space to remember the shortcuts for software and I like the extra exercise and variety of using mouse and keyboard, you should see my rhs flexor carpi radialis and extensor digitorum pair, quite something.

Regards, Bob

jwd

unread,
Nov 19, 2016, 12:17:30 PM11/19/16
to TiddlyWiki
Oh, very nice. Thanks @Bob for asking the question, @Riz for the solution, and @Mark for the suggestion to add a keyboard shortcut to that solution. That will save me some addition of date stamps that I've been using instead of full journal tiddlers; the repetitious entry of which has been starting to bug me.

tony

unread,
Nov 19, 2016, 7:40:17 PM11/19/16
to TiddlyWiki
2016-11-19T16:27:40-08:00 I'd like to echo all the thank you's to everyone on the thread as I've been waiting for a static datestamp ever since the editor toolbar came into being.

Importing @riz json tiddler did the trick with a slight modification to the date format per my preference (text=<<now 'YYYY-0MM-0DDT0hh:0mm:0ssTZD'>>)

I had been using vim with the it's all text plug-in to insert a date stamp and more recently came across this great toggle for the editor tool bar via TonGerner
http://tw5bookmarklets.tiddlyspot.com/ that allows a bookmarklets to be used in the TextArea tiddler body via StephanHradek with a modified datestamp bookmarklet.

So now there are three ways: with the editor toolbar, with a bookmarklet, or via vim for long edits

The nice thing about having @riz date stamp on the editor tool bar is that this current tw5 5.1.13 works on mobile as I am typing this on iOS via TWMobile by Chris Hunt
https://appsto.re/us/gwaXw.i which was last updated in 2014

I don't know how long these software tools will last and work with each other but at least data will be date stamped for preservation. Happy, happy

Best,
tony

Reply all
Reply to author
Forward
0 new messages