Difference between revisions of "Template:Gregorian serial date"

From blackwiki
Jump to navigation Jump to search
imported>Harryboyles
(Added {{pp-template}})
imported>Patrick
(/doc)
Line 1: Line 1:
<noinclude>
+
{{#expr:  
{{pp-template}}
 
This template gives the [[Gregorian calendar|Gregorian]] serial day. This is the numbers of days from the start of 1 A.D. (Monday, 1 Jan 1 = 1). (In the Gregorian Calendar there is no year 0) 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>{{Gregorian serial date|month = |day = |year = }}</nowiki>
 
 
 
'''Today's Date is'''
 
</noinclude>{{#expr:  
 
 
         <!--Days from all years past:-->
 
         <!--Days from all years past:-->
  
Line 35: Line 30:
 
  }}{{#ifexpr: {{{year|{{CURRENTYEAR}}}}} < 1 |
 
  }}{{#ifexpr: {{{year|{{CURRENTYEAR}}}}} < 1 |
 
         _ERROR - Can not handle dates before January 1, 1 A.D.
 
         _ERROR - Can not handle dates before January 1, 1 A.D.
   }}<noinclude>
+
   }}<noinclude>{{documentation}}</noinclude>
 
 
 
 
 
 
*<nowiki>{{gsd|year=1|month=1|day=1}}</nowiki> gives {{gsd|year=1|month=1|day=1}}
 
*<nowiki>{{gsd|year=2000|month=12|day=31}}</nowiki> gives {{gsd|year=2000|month=12|day=31}} (5 times the number of days of a cycle, 146,097)
 
*<nowiki>{{gsd|year=2000|month=1|day=1}}</nowiki> gives {{gsd|year=2000|month=1|day=1}}
 
*<nowiki>{{gsd|year=2001|month=1|day=1}}</nowiki> gives {{gsd|year=2001|month=1|day=1}}
 
*<nowiki>{{gsd|year=2001|month=2|day=28}}</nowiki> gives {{gsd|year=2001|month=2|day=28}}
 
*<nowiki>{{gsd|year=2001|month=3|day=1}}</nowiki> gives {{gsd|year=2001|month=3|day=1}}
 
 
 
See also:
 
*{{tiw|JULIANDAY}}
 
*{{tim|gsd}}
 
*{{tim|YMD2MJD}}
 
[[Category:Date mathematics templates|Gregorian serial date]]
 
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
 
 
 
[[ja:Template:Gregorian serial date]]
 
[[ko:틀:날짜]]
 
[[ml:ഫലകം:Gregorian serial date]]
 
[[nl:Sjablonen: Gregorian serial date]]
 
[[no:Mal:Gregorian serial date]]
 
[[ru:Шаблон:GSD]]
 
</noinclude>
 

Revision as of 10:54, 20 March 2008

739718

Template documentation[view] [edit] [history] [purge]

Usage

This template gives the serial day according to the proleptic Gregorian calendar, hence with the leap year exceptions of the 100 and 400 year rule, and with backward extrapolation, including year 0 and negative years, with Monday, 1 Jan 1 being day 1. This template handles . By default this template gives the serial for today. To find the serial for another date fill in the date into this code: {{Gregorian serial date|month = |day = |year = }}

Today's date is 739718.

Examples

  • {{gsd|year=-401|month=1|day=1}} gives -146826_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=-401|month=12|day=31}} gives -146462_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=-400|month=1|day=1}} gives -146461_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=-400|month=12|day=31}} gives -146096_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=-1|month=1|day=1}} gives -729_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=-1|month=12|day=31}} gives -365_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=0|month=1|day=1}} gives -364_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=0|month=12|day=31}} gives 1_ERROR - Can not handle dates before January 1, 1 A.D.
  • {{gsd|year=1|month=1|day=1}} gives 1
  • {{gsd|year=1|month=12|day=31}} gives 1
  • {{gsd|year=2000|month=12|day=31}} gives 730485 (5 times the number of days of a cycle, 146,097)
  • {{gsd|year=1985|month=1|day=1}} gives 724642
  • {{gsd|year=1985|month=4|day=12}} gives 724743
  • {{gsd|year=1981|month=8|day=12}} gives 723404
  • {{gsd|year=1953|month=10|day=2}} gives 713228

See also