Jump to content

Template:Year decimal

From NicheWork
Revision as of 11:21, 2 March 2018 by w>Frietjes (Created page with '{{<includeonly>safesubst:</includeonly>#expr:{{<includeonly>safesubst:</includeonly>#time:Y|{{{1|}}}}} + {{<includeonly>safesubst:</includeonly>#time:z|{{{1|}}}}...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

2026.0685

Template documentation

Computes the date and time as a "decimal year", which is useful for timeline or graph templates which don't naturally parse dates and times. The default is to use the current time, but the template can parse any date string supported by Time parser function.

Usage

Decimal year for the last time the page cache was refreshed:

  • {{Year decimal}} → 2026.0685

Decimal year for January 3, 2015

  • {{Year decimal|January 3, 2015}} → 2015.0055

Two weeks before January 3, 2015

  • {{Year decimal|January 3, 2015 -2 weeks}} → 2014.9671

Increasing the precision

  • {{Year decimal|January 3, 2015 -2 weeks|r=8}} → 2014.96712329

[[Category:Template documentation pages{{#translation:}}]]