# Template:YMD2MJD

12

Documentation

This documentation is transcluded from Template:YMD2MJD/doc.

Conversion from ISO 8601 year-month-day to Modified Julian Date (day number).

MJD = JD - 2400000.5

See Template talk:YMD2MJD for more documentation and test suites.

Usage:
{{YMD2MJD|year|[month]|[day]|[hour]|[minute]|[seconds]}}
{{YMD2MJD}}
Examples using only the Julian (including proleptic) calendar:
{{`YMD2MJD|-4712|01|01|12|00|00`}} = -2399998.5, 1 January 4713 BC 12:00 UTC (JD = 0)
{{`YMD2MJD|-0100|02|29`}} = -715407, 29 February 101 BC
{{`YMD2MJD|-0100|03|01`}} = -715406, 1 March 101 BC (proleptic Julian leap year)
{{`YMD2MJD|-0100|03|02`}} = -715405, 2 March 101 BC
{{`YMD2MJD|-0000|02|28`}} = -678883, 28 February 1 BC
{{`YMD2MJD|-0000|02|29`}} = -678882, 29 February 1 BC
{{`YMD2MJD|0000|03|01`}} = -678881, 1 March 1 BC
{{`YMD2MJD|0000|12|31`}} = -678576, 31 December 1 BC (Astronomical year numbering)
{{`YMD2MJD|0001|01|01`}} = -678575, begin Common Era
{{`YMD2MJD|0200|02|29`}} = -605832, this and earlier dates are Julian
Examples in the 3rd century using the Julian or (proleptic) Gregorian calendar:
{{`YMD2MJD|0200|03|01`}} = -605831, first Julian = Gregorian date
{{`YMD2MJD|0300|02|28`}} = -569310, last Julian = Gregorian date
Examples using only the Gregorian (including proleptic) calendar:
{{`YMD2MJD|0300|03|01`}} = -569309, this and later dates are Gregorian
{{`YMD2MJD|1858|11|17`}} = 0, begin of MJD epoch
{{`YMD2MJD|1900|02|28`}} = 15078, last day of February 1900
{{`YMD2MJD|1900|02|29`}} = 15079, bogey but okay
{{`YMD2MJD|1900|03|01`}} = 15079, no leap year
{{`YMD2MJD|1900|02|30`}} = 15080, bogey but okay
{{`YMD2MJD|1900|03|02`}} = 15080
{{`YMD2MJD|1995|09|27`}} = 49987, USNO test date (49987)
{{`YMD2MJD|2000|02|29`}} = 51603, last day of February 2000
{{`YMD2MJD|2000|02|30`}} = 51604, bogey but okay
{{`YMD2MJD|2000|03|01`}} = 51604, leap year
{{`YMD2MJD|2000|02|31`}} = 51605, bogey but okay
{{`YMD2MJD|2000|03|02`}} = 51605
{{`YMD2MJD|2015|05|29`}} = 57171
Example using the current date:
`{{YMD2MJD}}` gives 57171 [1]