Template:Date serial: Difference between revisions

From MicrasWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 15: Line 15:
       <!--Days so far this year:-->
       <!--Days so far this year:-->
   
   
         + {{ #ifexpr:  
         + {{#time: z |{{{day|{{CURRENTDAY}}}}} {{#time: F|1 {{{month|{{CURRENTMONTHNAME}}}}} 2021}} {{{year|{{CURRENTYEAR}}}}}
                      ({{{month|{{CURRENTMONTH}}}}} - 1) < 8
                      | ( ({{{month|{{CURRENTMONTH}}}}} - 1) * 30.5 round 0)
                      | ( ({{{month|{{CURRENTMONTH}}}}} - 1) * 30.5 + 0.9 round 0 )
          }}  
        - {{ #ifexpr:   <!-- if leap year  -->
                    ({{{year|{{CURRENTYEAR}}}}} / 4) = ({{{year|{{CURRENTYEAR}}}}} / 4 round 0)          <!--If divisible by 4-->
                      and ({{{year|{{CURRENTYEAR}}}}} / 100 != {{{year|{{CURRENTYEAR}}}}} / 100 round 0)  <!--and not by 100-->
                  | 1 | 2
           }}
           }}
         + {{ #ifexpr: <!--400 year exception-->
 
                ({{{year|{{CURRENTYEAR}}}}} / 400) = ({{{year|{{CURRENTYEAR}}}}} / 400 round 0)
         + {{#ifeq: {{{year}}}|{{CURRENTYEAR}}|0|1}}
                  | 1 | 0
          }}
        + {{{day|{{CURRENTDAY}}}}}
}}
}}
<noinclude>
<noinclude>
[[Category:MicrasWiki]]
[[Category:MicrasWiki]]
</noinclude>
</noinclude>

Latest revision as of 07:15, 14 July 2021

This template gives the Gregorian serial day. This is the numbers of days since 1 A.D. This template should handle all leap year exceptions including the 100 and 400 year rule. By default this template gives the serial for today. To find the serial for another date fill in the date into this code:

{{Date serial|day = |month = |year = }}

Today's Date is

739656