Template:Orddate

From SikhiWiki
Revision as of 08:40, 15 July 2008 by Hari singh (talk | contribs) (New page: {{{{{subst|}}}#expr: {{{{{subst|}}}#switch: {{{2|{{CURRENTMONTH}}}}}|1=365|2=396|3=59|4=90|5=120|6=151|7=181|8=212|9=243|10=273|11=304|12=334|badmonth}} +{{{3|{{CURRENTDAY}}}}} +( 365.25*...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

{{#expr: {{#switch: 04|1=365|2=396|3=59|4=90|5=120|6=151|7=181|8=212|9=243|10=273|11=304|12=334|badmonth}} +25 +( 365.25* (2024-(04<3)) -0.375 round 0) - ( 365.25* 2024- .25 -0.375 round 0) -(2024>=0)*

(
( (2024-(04<3)) /100 -0.495 round 0) 

-( (2024-1) /100 -0.495 round 0) -( (2024-(04<3)) /400 -0.49875 round 0) +( (2024-1) /400 -0.49875 round 0)) }}


Finds the ordinal date within a year.

Example:
Template:Evaldemo/3
Check the result at tycho.usno.navy.mil after Template:Purge this page.
Examples for 15-MAR-2007 and 15-MAR-2008 (leap year):
Template:Evaldemo/3
Template:Evaldemo/3
Optional substitution works if all three variables are specified:
{{ subst:orddate|year|month|day|subst=subst:}}