<!-- generated by scripts/docs/generate-reference.ts — do not edit -->

astro_date_convert

Calendar and timezone conversions — julian-gregorian, timezone, easter-date.

  • Layer: utility
  • Methods: julian-gregorian, timezone, easter-date
  • Free tier: julian-gregorian, timezone, easter-date
  • Paid tier:

Description

Calendar and timezone conversions — julian-gregorian, timezone, easter-date.

Methods:
  julian-gregorian [Free] — convert a date between the Julian and Gregorian calendars, with Julian Day Number + weekday
  timezone         [Free] — convert a wall-clock date/time from one IANA timezone to another via UTC
  easter-date      [Free] — date of Easter for a year in the Western (Gregorian) or Orthodox (Julian) tradition

Input schema

julian-gregorian

FieldTypeRequiredConstraints
date.yearintegeryesmin -4712, max 4000, int
date.monthintegeryesmin 1, max 12, int
date.dayintegeryesmin 1, max 31, int
calendar"julian" | "gregorian"yes

Example request

{
  "method": "julian-gregorian",
  "date": {
    "year": 1642,
    "month": 12,
    "day": 25
  },
  "calendar": "julian"
}

Example response (captured; long values elided)

{
  "gregorian": {
    "year": 1643,
    "month": 1,
    "day": 4
  },
  "julian": {
    "year": 1642,
    "month": 12,
    "day": 25
  },
  "jdn": 2321157,
  "weekday": "Sunday"
}

timezone

FieldTypeRequiredConstraints
dateTime.yearintegeryesmin 1900, max 2100, int
dateTime.monthintegeryesmin 1, max 12, int
dateTime.dayintegeryesmin 1, max 31, int
dateTime.hourintegeryesmin 0, max 23, int
dateTime.minuteintegeryesmin 0, max 59, int
dateTime.secondintegernomin 0, max 59, int
fromZonestringyesminLength 1
toZonestringyesminLength 1

Example request

{
  "method": "timezone",
  "dateTime": {
    "year": 2024,
    "month": 6,
    "day": 1,
    "hour": 12,
    "minute": 0
  },
  "fromZone": "Europe/London",
  "toZone": "America/New_York"
}

Example response (captured; long values elided)

{
  "utc": {
    "zone": "UTC",
    "year": 2024,
    "month": 6,
    "day": 1,
    "hour": 11,
    "minute": 0,
    "second": 0,
    "offsetMinutes": 0
  },
  "from": {
    "zone": "Europe/London",
    "year": 2024,
    "month": 6,
    "day": 1,
    "hour": 12,
    "minute": 0,
    "second": 0,
    "offsetMinutes": 60
  },
  "to": {
    "zone": "America/New_York",
    "year": 2024,
    "month": 6,
    "day": 1,
    "hour": 7,
    "minute": 0,
    "second": 0,
    "offsetMinutes": -240
  }
}

easter-date

FieldTypeRequiredConstraints
yearintegeryesmin 326, max 4000, int
tradition"western" | "orthodox"no

Example request

{
  "method": "easter-date",
  "year": 2024
}

Example response (captured; long values elided)

{
  "year": 2024,
  "tradition": "western",
  "gregorian": {
    "year": 2024,
    "month": 3,
    "day": 31
  },
  "julian": {
    "year": 2024,
    "month": 3,
    "day": 18
  }
}