RationalWiki's 2018 Fundraiser

There is no RationalWiki without you. We are a small non-profit with no staff — we are hundreds of volunteers who document pseudoscience and crankery around the world every day. We will never allow ads because we must remain independent. We cannot rely on big donors with corresponding big agendas. We are not the largest website around, but we believe we play an important role in defending truth and objectivity.

If everyone seeing this today donates $5, we will meet our goal for 2018.

Fighting pseudoscience isn't free.
We are 100% user-supported! Help and donate $5, $20 or whatever you can today with PayPal Logo.png!

Donations so far: $2397Goal: $5000

Help:How to make a day counter

From RationalWiki
Jump to: navigation, search

Note: This is a largely historical article. See Template:Countdown.

Day counters (214 days until the king is dead) can be made using parser functions. It's generally easiest to use the day of the year ({{ #time: z }} in the expressions below; 1 January = 0, 2 January = 1, 3 January = 2, etc.) in the parser function. The parser function also allows you to do calculations with the days of the year (or week of the year or month etc.).

Days since calculation:

Use the following
{{ #expr: ( 32 + {{ #time: z }} ) }}
which gives 320. You will have to adjust the number (in this case 32) to give the correct number of "days since" for the current date

Days until calculation:

Use the following
{{ #expr: ( 366 - {{ #time: z }} ) }}
which gives 78. You will have to adjust the number (in this case 366) to give the correct number of "days until" for the current date.

You will have to update your day counter on the first of the year (or use a more complicated function for the calculation--coming soon).