Browse the docs

jd

Returns the Julian date for a calendar date and time.

Keyboard Maestro: JD

Details #

jd(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 Julian date counts days (with a fraction for the time of day) from noon on 1 January 4713 BC. Noon UTC on 1 January 2000 is 2451545.

Parameters #

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

Examples #

jd(2000, 1, 1, 12)
→ 2451545
jd(2026, 10, 24)
→ 2.46134e+06

Gotchas #

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

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

  • A Julian date starts at noon, so midnight has a fraction of .5: jd(2000, 1, 1) is 2451544.5.