Thread:Mathmagician/@comment-3153244-20120825140053/@comment-4674838-20120825171314

SW8573 wrote: Hi! When adding a timestamp to your sig, do you have to manually add the and/or the ?

Secondly, do you do have to add anything to (e.g.) for the timestamp to show up like that?

Nope, I don't have to manually type &#126;&#126;&#126;&#126;&#126; when signing my posts. But you do have to use the #time parser function in your preferences to get a custom timestamp.

Yes, there is a particular piece of code that handles the timestamp for me.

How my signature works:

In Special:Preferences, I have the following: UTC There's a few different things going on in that code. I'm using #ifexist to detect whether or not User:Mathmagician/sig exists on the wiki in question. If it does, User:Mathmagician/sigPref is substituted. If it doesn't, that means I haven't added those 2 templates to the wiki yet, so a default signature is used instead. The #ifexist solution prevents the problem where you sometimes see signatures like

&#123;&#123;SUBST:User:Me/sig&#125;&#125; 17:13, August 25, 2012 (UTC)

because the person hasn't added their sig template to the wiki yet.

The way the timestamp works is that I use the #time parser function to get the current time, and I pass it as a parameter (3 parameters, actually) to the /sigPref template, which in turn passes it along to the /sig template.

The syntax for #ifexist and #time parser functions can be found at mw:Help:Extension:ParserFunctions.

P.S. With this set up, I have to sign my posts with only 3 tildes: &#126;&#126;&#126;