Browse the docs

mjd

Returns the modified Julian date for a calendar date and time.

Keyboard Maestro: MJD

Details #

mjd(year, month?, day?, hour?, minute?, second?) takes 1 to 6 arguments and returns a number with decimals. Month and day default to 1, hour and minute to 0. The date is read as UTC, not local time. The sixth argument, seconds, is added to the moment afterwards and may have decimals.

The modified Julian date is the Julian date minus 2400000.5, so it starts at midnight and the numbers are smaller. Midnight UTC on 1 January 2000 is 51544.

Parameters #

Takes 1 to 6 arguments. {{ mjd(text, b?, c?, c?, c?, c?) }}

Examples #

mjd(2000, 1, 1)
→ 51544
mjd(2026, 10, 24, 12)
→ 61337.5

Gotchas #

  • A date that doesn't exist stops the step: mjd() got a date that doesn't exist.

  • Anything that isn't a number is an error: mjd() needs a number, got text.