Difference between revisions of "Template:OutageCounter"

From CWCki
Jump to navigation Jump to search
(Reset the counter, because the simplistic math doesn't account for year change. Better to be slightly wrong than completely wrong =))
(Finally replaced the whole thing with a version that should work over new years.)
Line 1: Line 1:
{{#expr: (-0 +{{#time:z}})}} days without an outage!<noinclude>
{{#expr: (-1262392358 +{{#time:U}})/86400 round 0}} days without an outage!<noinclude>


Here's the code I whipped up:<nowiki>{{#expr: (-xxx +{{#time:z}})}}</nowiki>
== How to update ==
<br>To calculate the date to put in without having to figure it out manually use http://mistupid.com/calendar/dayofyear.htm
<br>Then replace xxx with the calculated date.--[[User:Ror|Ror]]


Today is day {{#time:z}}
# Copy the current time stamp off this fine template page: '''{{#time:U}}'''
# Hit edit.
# Look at the mysterious code that's at the top of the page that looks like this:<br/><nowiki>{{#expr: (-XXXXX +{{#time:U}})/86400 round 0}}</nowiki>
# Replace the current number at XXXXX with the new time stamp. Leave the minus sign in!
# Save.
 
By [[User:Ror|Ror]] and [[User:Wwwwolf|wwwwolf]].


[[Category:Front page templates]]</noinclude>
[[Category:Front page templates]]</noinclude>

Revision as of 19:46, 1 January 2010

5438 days without an outage!

How to update

  1. Copy the current time stamp off this fine template page: 1732205257
  2. Hit edit.
  3. Look at the mysterious code that's at the top of the page that looks like this:
    {{#expr: (-XXXXX +{{#time:U}})/86400 round 0}}
  4. Replace the current number at XXXXX with the new time stamp. Leave the minus sign in!
  5. Save.

By Ror and wwwwolf.