Help talk:How to make a day counter
Jump to navigation
Jump to search
Sid: could you put a worked example on the page ( 2 versions: nowikied & not nowikied)? 'Cause it's not that clear (to me anyhoo). SusanHelp I'm being haunted by TK 11:42, 7 January 2008 (EST)
- Uhm... I didn't write this help page... but we're using time functionality in Template:Presdays, and it looks just like the stuff in the article...
- {{#time:z}} is the day of the year: 356 (it starts at 0, so today on Jan 7th, it says "6" - this will be important for calculations, depending on what result you expect, see example below)
- And with that, you can count up or down. For example, if you want a timer to count down so that it reaches 0 today, you could count down to it like this:
- {{#expr: (6-{{#time:z}})}} gives: -350
- (Tomorrow, this will likely give "-1" or something as an answer...)
- Likewise, you could count down to Dec 31 (day 366) with {{#expr: (365-{{#time:z}})}} and get 9 as a result.
- Further reading about other time parameters here --Sid 12:04, 7 January 2008 (EST)
Sorry Sid (& Sterile), I had just assumed it was yours. I'll go away for a while & work on it.SusanHelp I'm being haunted by TK 12:14, 7 January 2008 (EST)