Jump to content

Template:Year decimal: Difference between revisions

From NicheWork
w>Frietjes
Created page with '{{<includeonly>safesubst:</includeonly>#expr:{{<includeonly>safesubst:</includeonly>#time:Y|{{{1|}}}}} + {{<includeonly>safesubst:</includeonly>#time:z|{{{1|}}}}...'
 
m 1 revision imported
 
(No difference)

Latest revision as of 13:40, 19 January 2026

2026.0658

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.0658

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:}}]]