Template:Orddate

From SikhiWiki
Jump to navigationJump to search

{{#expr: {{#switch: 05|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}} +26 +( 365.25* (2022-(05<3)) -0.375 round 0) - ( 365.25* 2022- .25 -0.375 round 0) -(2022>=0)*

(
( (2022-(05<3)) /100 -0.495 round 0) 

-( (2022-1) /100 -0.495 round 0) -( (2022-(05<3)) /400 -0.49875 round 0) +( (2022-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:}}