Template:Date serial: Difference between revisions

From MicrasWiki
Jump to navigationJump to search
Created page with "<noinclude> 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..."
 
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
This template gives the [[Gregorian calendar|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: '''<nowiki>{{Date serial|day = |month = |year = }}</nowiki>
This template gives the [[wikipedia:Gregorian calendar|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: '''<pre>{{Date serial|day = |month = |year = }}</pre>


==Today's Date is==
==Today's Date is==
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:Date math|Gregorian serial date]]
[[Category:MicrasWiki]]
[[Category:Templates using ParserFunctions]]
</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

739655