dev

Timespan is a Lua module that streamlines the declaration of geological timespans. Instead of manually searching and determining a time's stage and period, provide the time in millions of years (though there are other cases that require other inputs), and the module returns the corresponding stage and time. It references the International Chronostratigraphic Chart (latest version, December 2024) maintained by the International Commission on Stratigraphy.

Installation

Create Module:Timespan on your wiki with this code:

return require('Dev:Timespan')

Then make Template:Timespan with this as the content:

{{#if:{{{1|}}}
 | {{#invoke:Timespan|main|{{{1}}}|{{{2|}}}|{{{3|}}}}}
}}

Examples

# Case Input Output
01 Single point in time. {{Timespan|75}} 75 million years ago, Campanian Stage, Late Cretaceous Period
02 Single point in time, formatted. {{Timespan|75||1}} 75 million years ago, during the Campanian Stage of the Late Cretaceous Period
03 Two points in time. {{Timespan|75|72.2}} 75 – 72.2 million years ago, Campanian – Maastrichtian Stage, Late Cretaceous Period
04 Two points in time, formatted. {{Timespan|75|72.2|1}} 75 – 72.2 million years ago, from the Campanian to the Maastrichtian Stage of the Late Cretaceous Period
05 When at the boundary, and you still want the second point in time to fall into the first period, refer to the timescale for details, and make the second time be greater or equal to the boundary of the targeted geological time scale division (in this case, the Campanian Stage). The module takes that exact value, but for display, it rounds off to the nearest thousandths, and removes trailing zeroes. {{Timespan|75|72.200002|1}} 75 – 72.2 million years ago, during the Campanian Stage of the Late Cretaceous Period
06 Output time lesser than 1 million years. {{Timespan|0.1|0.01}} 100,000 – 10,000 years ago, Late Pleistocene Epoch, Quaternary Period to Greenlandian Stage, Holocene Epoch, Quaternary Period
07 Output time lesser than 1 million years, formatted. {{Timespan|0.1|0.01|1}} 100,000 – 10,000 years ago, from the Late Pleistocene Epoch, Quaternary Period to the Greenlandian Stage of the Holocene Epoch, Quaternary Period
08 Output time with BC. {{Timespan|2.58|70000BC}} 2.58 million years ago – 70000 BC, Gelasian Stage, Early Pleistocene Epoch, Quaternary Period to Late Pleistocene Epoch, Quaternary Period
09 Output time with AD. {{Timespan|2.58|AD1768}} 2.58 million years ago – AD 1768, Gelasian Stage, Early Pleistocene Epoch, Quaternary Period to Meghalayan Stage, Holocene Epoch, Quaternary Period
10 Output time with BC or AD. {{Timespan|100000BC|AD1700}} 100000 BC – AD 1700, Late Pleistocene Epoch, Quaternary Period to Meghalayan Stage, Holocene Epoch, Quaternary Period
11 Output time with BC or AD, formatted. {{Timespan|100000BC|AD1700|1}} 100000 BC – AD 1700, from the Late Pleistocene Epoch, Quaternary Period to the Meghalayan Stage of the Holocene Epoch, Quaternary Period
12 Output time with BC or AD, century. {{Timespan|BCc1000|ADc17}} 1000th century BC – 17th century AD, Late Pleistocene Epoch, Quaternary Period to Meghalayan Stage, Holocene Epoch, Quaternary Period
13 Output time with BC or AD, century, formatted. {{Timespan|BCc1000|ADc17|1}} 1000th century BC – 17th century AD, from the Late Pleistocene Epoch, Quaternary Period to the Meghalayan Stage of the Holocene Epoch, Quaternary Period
14 Output time with BC or AD, millennium. {{Timespan|BCm100|ADm2}} 100th millennium BC – 2nd millennium AD, Late Pleistocene Epoch, Quaternary Period to Meghalayan Stage, Holocene Epoch, Quaternary Period
15 Output time with BC or AD, millennium, formatted. {{Timespan|BCm100|ADm2|1}} 100th millennium BC – 2nd millennium AD, from the Late Pleistocene Epoch, Quaternary Period to the Meghalayan Stage of the Holocene Epoch, Quaternary Period