Difference between revisions of "Template:JD/Gregorian"
Jump to navigation
Jump to search
imported>Verdy p m (error in documentation only) |
imported>Verdy p m |
||
| Line 1: | Line 1: | ||
| − | <includeonly>{{#expr:(((({{{2}}})+57608.5 round 0)/12 | + | <includeonly>{{#expr: |
| + | (((({{{1}}})*12+({{{2}}})+57608.5 round 0)/12-1.5 round 0)*1461/4-0.5 round 0)- | ||
| + | (((({{{1}}})*12+({{{2}}})+57608.5 round 0)/12-1.5 round 0)/100-0.5 round 0)+ | ||
| + | (((({{{1}}})*12+({{{2}}})+57608.5 round 0)/12-1.5 round 0)/400-0.5 round 0)+ | ||
| + | (((({{{1}}})*12+({{{2}}})+57608.5 round 0)mod 12+4)*153/5-0.5 round 0)+ | ||
| + | ({{{3}}})+({{{4|12}}})/24+({{{5|0}}})/1440+({{{6|0}}})/86400-32167.5}}</includeonly><noinclude>{{Template documentation}} | ||
This template convert [[Gregorian calendar]] to [[Julian date]]. The returned value is an integer at noon. | This template convert [[Gregorian calendar]] to [[Julian date]]. The returned value is an integer at noon. | ||
| Line 10: | Line 15: | ||
* At least the three first date elements are required. | * At least the three first date elements are required. | ||
* Date elements are interpreted in the (possibly proleptic) Gregorian calendar, and accepts a negative or nul ''year'' (considered in the UTC astronomical calendar). | * Date elements are interpreted in the (possibly proleptic) Gregorian calendar, and accepts a negative or nul ''year'' (considered in the UTC astronomical calendar). | ||
| − | * The ''year'' and ''month'' parameters are rounded | + | * The ''month'' parameter is usually between 1 and 12; however it is used relatively from the start of the specified ''year'' (a Julian year is exactly 12 Julian months); so the ''year'' and ''month'' parameters can both include decimals and are first converted into a rounded number of Julian months since December 4800 BC; for this initial computing, the ''day'' parameter and time element parameters are ignored. |
| − | * The ''day'' and time element parameters may have decimals or can be out of the range of regular days | + | * The ''day'' and time element parameters may have decimals or can be out of the range of regular Julian days. |
| − | * The ''hour'' parameter is 0 to 23 within the same day, but can extend to any value; if missing, its takes default is 12 for noon. | + | * The ''hour'' parameter is 0 to 23 within the same day, but can extend to any value (for computing other days); if missing, its takes default is 12 for noon (which is the start of a Julian day). |
| − | * The ''minute'' and ''second'' parameter are 0 to 59, but can extend to any value; if missing,their default is 0. | + | * The ''minute'' and ''second'' parameter are usually 0 to 59, but can extend to any value; if missing, their default is 0. |
* No correction is applied for (unpredictable and irregular in the past) leap seconds in the UTC calendar (all days are considered 24 hours exactly), so the returned value is not an exact timestamp with linear growth. | * No correction is applied for (unpredictable and irregular in the past) leap seconds in the UTC calendar (all days are considered 24 hours exactly), so the returned value is not an exact timestamp with linear growth. | ||
; Examples<nowiki>:</nowiki> | ; Examples<nowiki>:</nowiki> | ||
| + | * <nowiki>{{JD/Gregorian|1782|10|15|12|00|00}}</nowiki> returns {{JD/Gregorian|1782|10|15|12|00|00}} (first instant of the Gregorian calendar). | ||
* <nowiki>{{JD/Gregorian|2000|02|29}}</nowiki> returns {{JD/Gregorian|2000|02|29}}. | * <nowiki>{{JD/Gregorian|2000|02|29}}</nowiki> returns {{JD/Gregorian|2000|02|29}}. | ||
* <nowiki>{{JD/Gregorian|2000|02|29|23|59|59}}</nowiki> returns {{JD/Gregorian|2000|02|29|23|59|59}}. | * <nowiki>{{JD/Gregorian|2000|02|29|23|59|59}}</nowiki> returns {{JD/Gregorian|2000|02|29|23|59|59}}. | ||
Revision as of 09:02, 30 April 2006
Template:Template documentation
This template convert Gregorian calendar to Julian date. The returned value is an integer at noon.
- Syntax:
- {{JD/Gregorian|year|month|day|hour|minute|second}}
- {{JD/Gregorian|year|month|day|hour|minute}}
- {{JD/Gregorian|year|month|day|hour}}
- {{JD/Gregorian|year|month|day}}
- At least the three first date elements are required.
- Date elements are interpreted in the (possibly proleptic) Gregorian calendar, and accepts a negative or nul year (considered in the UTC astronomical calendar).
- The month parameter is usually between 1 and 12; however it is used relatively from the start of the specified year (a Julian year is exactly 12 Julian months); so the year and month parameters can both include decimals and are first converted into a rounded number of Julian months since December 4800 BC; for this initial computing, the day parameter and time element parameters are ignored.
- The day and time element parameters may have decimals or can be out of the range of regular Julian days.
- The hour parameter is 0 to 23 within the same day, but can extend to any value (for computing other days); if missing, its takes default is 12 for noon (which is the start of a Julian day).
- The minute and second parameter are usually 0 to 59, but can extend to any value; if missing, their default is 0.
- No correction is applied for (unpredictable and irregular in the past) leap seconds in the UTC calendar (all days are considered 24 hours exactly), so the returned value is not an exact timestamp with linear growth.
- Examples:
- {{JD/Gregorian|1782|10|15|12|00|00}} returns 2372210 (first instant of the Gregorian calendar).
- {{JD/Gregorian|2000|02|29}} returns 2451604.
- {{JD/Gregorian|2000|02|29|23|59|59}} returns 2451604.4999884.
- {{JD/Gregorian|2000|03|01|00}} returns 2451604.5.
- {{JD/Gregorian|2000|03|01}} returns 2451605.
- {{JD/Gregorian|2000|03|01|12}} returns 2451605.
- {{JD/Gregorian|2000|03|01|12|00|01}} returns 2451605.0000116.
- {{JD/Gregorian|2000|03|01|12|01}} returns 2451605.0006944.
- {{JD/Gregorian|2000|03|01|13}} returns 2451605.0416667.
- {{JD/Gregorian|2000|03|01|24}} returns 2451605.5.
- {{JD/Gregorian|2000|03|02|00}} returns 2451605.5.
- {{JD/Gregorian|2000|03|01|36}} returns 2451606.
- {{JD/Gregorian|2000|03|02}} returns 2451606.
- {{JD/Gregorian|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|{{CURRENTHOUR}}||{{CURRENTMINUTE}}}} returns 2461134.8541667
- See also: