Difference between revisions of "Template:Date serial"
Jump to navigation
Jump to search
imported>Maelgwnbot m (Bot Updating template fields, {{tl|Template doc}}) |
imported>HUB m (+interwiki) |
||
| Line 3: | Line 3: | ||
{{JULIANDAY|{{{3|{{#ifexpr:{{{leapyear|0}}}|4|1}}}}}|1|0}} | {{JULIANDAY|{{{3|{{#ifexpr:{{{leapyear|0}}}|4|1}}}}}|1|0}} | ||
}}</includeonly><noinclude>{{Documentation, template}} | }}</includeonly><noinclude>{{Documentation, template}} | ||
| + | [[es:Plantilla:Date serial]] | ||
[[Category:Date mathematics templates|{{PAGENAME}}]] | [[Category:Date mathematics templates|{{PAGENAME}}]] | ||
[[Category:Templates using ParserFunctions|{{PAGENAME}}]] | [[Category:Templates using ParserFunctions|{{PAGENAME}}]] | ||
</noinclude> | </noinclude> | ||
Revision as of 17:53, 3 August 2008
This template returns the date serial in year for a date specified by month number and day of month. By default the year is considered non leap, but this may be overridden.
- Syntax:
- {{Date serial|month number|day of month}}
- {{Date serial|month number|day of month|year}}
- {{Date serial|month number|day of month|leapyear=is leap}}
- The year parameter is optional, if specified, the named leapyear parameter is ignored.
- The named leapyear parameter (optional, default value 0, unless year is specified) is non-zero to get the proper date serial on dates starting at March 1st on leap years.
Examples
{{date serial|{{CURRENTMONTH}}|{{CURRENTDAY}}|leapyear={{isLeapYear}}}}→ 14{{date serial|1|1}}→ 1{{date serial|1|1|2000}}→ 1{{date serial|1|1|leapyear=1}}→ 1{{date serial|2|28}}→ 59{{date serial|3|1}}→ 60{{date serial|3|1|leapyear=0}}→ 60{{date serial|3|1|1999}}→ 60{{date serial|3|1|leapyear=1}}→ 61{{date serial|3|1|2000}}→ 61{{date serial|3|26}}→ 85{{date serial|5|1}}→ 121{{date serial|12|31}}→ 365{{date serial|12|31|leapyear=1}}→ 366{{date serial|12|31|1999}}→ 365{{date serial|12|31|2000}}→ 366
Days since September 1st:
{{#expr: {{date serial|{{CURRENTMONTH}}|{{CURRENTDAY}}}} - {{date serial|9|1}} }}→ -230
First Sunday in November is November Template:Weekday in month, 2026
{{date serial|11|{{Weekday in month|{{CURRENTYEAR}}|11|0|1}} }}→ Expression error: Unexpected < operator.
Self test
| Test | Result |
|---|---|
{{date serial|1|13}} |
Pass |
{{date serial|2|12}} |
Pass |
{{date serial|3|16}} |
Pass |
{{date serial|4|1}} |
Pass |
{{date serial|4|2|leapyear=1}} |
Pass |
See also
- {{Gregorian serial date}} for the number of days since 0 A.D accounting for leap years.
- {{Age in days}} for the number of days between any two dates.
| The above documentation is transcluded from Template:Date serial/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |