Skip to content
ToolsOnDuty - free online tools
ToolsOnDuty / docs
Browse documentation

Reference / Date & Time

Date & Time API

25 endpoints for date & time workflows. Every call requires bearer authentication and uses the standard ToolsOnDuty response envelope.

Try it

Runs a real request from your browser to your own ToolsOnDuty account. Your key is only kept in this page and is never stored.

POST/v1/datetime/age1 credit / call

Age calculator

Exact calendar age and next-birthday countdown between a date of birth and a reference date.

ParameterTypeRequiredDescription
dateOfBirthstringYesDate of birth, YYYY-MM-DD.
asOfstringNoReference date, YYYY-MM-DD. Defaults to today (UTC).

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/age \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"dateOfBirth":"1990-05-15","asOf":"2026-01-01"}'

Response

{
  "ok": true,
  "data": {
    "years": 35,
    "months": 7,
    "days": 17
  }
}
POST/v1/datetime/difference1 credit / call

Date difference

Elapsed years, months and days between two dates (exclusive or inclusive of the end date).

ParameterTypeRequiredDescription
startDatestringYesStart date, YYYY-MM-DD.
endDatestringYesEnd date, YYYY-MM-DD.
modestringNoexclusive | inclusive. Default: exclusive.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/difference \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"startDate":"2020-01-01","endDate":"2026-06-15"}'

Response

{
  "ok": true,
  "data": {
    "years": 6,
    "months": 5,
    "days": 14
  }
}
POST/v1/datetime/offset1 credit / call

Add or subtract calendar time

Add or subtract days, weeks, months or years from a date.

ParameterTypeRequiredDescription
datestringYesStart date, YYYY-MM-DD.
operationstringYesadd | subtract.
amountnumberYesNon-negative whole number amount.
unitstringYesdays | weeks | months | years.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/offset \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-01-01","operation":"add","amount":90,"unit":"days"}'

Response

{
  "ok": true,
  "data": {
    "date": {
      "year": 2026,
      "month": 4,
      "day": 1
    }
  }
}
POST/v1/datetime/weekday1 credit / call

Day of the week

Return the Gregorian weekday name and index (0=Sunday) for a date.

ParameterTypeRequiredDescription
datestringYesDate, YYYY-MM-DD.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/weekday \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-01-01"}'

Response

{
  "ok": true,
  "data": {
    "dayName": "Thursday",
    "dayIndex": 4
  }
}
POST/v1/datetime/iso-week1 credit / call

ISO week number

ISO-8601 week number, week-year and the start/end dates of that week.

ParameterTypeRequiredDescription
datestringYesDate, YYYY-MM-DD.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/iso-week \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-01-01"}'

Response

{
  "ok": true,
  "data": {
    "weekNumber": 1,
    "weekYear": 2026
  }
}
POST/v1/datetime/calendar-month1 credit / call

Monthly calendar grid

A Monday-first calendar grid and metadata for a given year and month.

ParameterTypeRequiredDescription
yearnumberYesCalendar year.
monthnumberYesMonth (1-12).

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/calendar-month \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"year":2026,"month":1}'

Response

{
  "ok": true,
  "data": {
    "numberOfDays": 31,
    "firstWeekday": "Thursday"
  }
}
POST/v1/datetime/calendar-year2 credits / call

Yearly calendar grid

A full 12-month calendar grid and leap-year metadata for a given year.

ParameterTypeRequiredDescription
yearnumberYesCalendar year.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/calendar-year \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"year":2026}'

Response

{
  "ok": true,
  "data": {
    "isLeapYear": false,
    "numberOfDays": 365
  }
}
POST/v1/datetime/day-of-year1 credit / call

Day of the year

Ordinal day number within the year, days remaining and percent elapsed.

ParameterTypeRequiredDescription
datestringYesDate, YYYY-MM-DD.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/day-of-year \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-04-10"}'

Response

{
  "ok": true,
  "data": {
    "dayOfYear": 100,
    "daysRemaining": 265
  }
}
POST/v1/datetime/day-count1 credit / call

Day count between dates

Count calendar days between two dates, exclusive or inclusive of the end date.

ParameterTypeRequiredDescription
startDatestringYesStart date, YYYY-MM-DD.
endDatestringYesEnd date, YYYY-MM-DD.
modestringNoexclusive | inclusive. Default: exclusive.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/day-count \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"startDate":"2026-01-01","endDate":"2026-12-31"}'

Response

{
  "ok": true,
  "data": {
    "totalDays": 364,
    "mode": "exclusive"
  }
}
POST/v1/datetime/countdown1 credit / call

Countdown timer

Break the gap between two Unix millisecond timestamps into days, hours, minutes and seconds.

ParameterTypeRequiredDescription
fromMsnumberYesStart instant, Unix milliseconds.
toMsnumberYesTarget instant, Unix milliseconds.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/countdown \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"fromMs":0,"toMs":90061000}'

Response

{
  "ok": true,
  "data": {
    "days": 1,
    "hours": 1,
    "minutes": 1,
    "seconds": 1
  }
}
POST/v1/datetime/quarter1 credit / call

Calendar and fiscal quarter

Calendar quarter and, given a fiscal-year start month, the fiscal quarter for a date.

ParameterTypeRequiredDescription
datestringYesDate, YYYY-MM-DD.
fiscalStartMonthnumberNoFiscal year start month (1-12). Default: 1.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/quarter \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-04-15"}'

Response

{
  "ok": true,
  "data": {
    "calendarQuarter": 2,
    "calendarQuarterLabel": "Q2"
  }
}
POST/v1/datetime/zodiac1 credit / call

Western zodiac sign

The western (tropical) zodiac sign for a month and day.

ParameterTypeRequiredDescription
monthnumberYesMonth (1-12).
daynumberYesDay of month (1-31).

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/zodiac \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"month":8,"day":23}'

Response

{
  "ok": true,
  "data": {
    "name": "Virgo",
    "symbol": "♍",
    "element": "Earth"
  }
}
POST/v1/datetime/chinese-zodiac1 credit / call

Chinese zodiac

Chinese zodiac animal, element and yin/yang for a year.

ParameterTypeRequiredDescription
yearnumberYesYear.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/chinese-zodiac \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"year":2026}'

Response

{
  "ok": true,
  "data": {
    "animal": "Horse",
    "element": "Fire",
    "yinYang": "Yang"
  }
}
POST/v1/datetime/moon-phase1 credit / call

Moon phase

Approximate moon phase, illumination and moon age (in days) for a date.

ParameterTypeRequiredDescription
datestringYesDate, YYYY-MM-DD.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/moon-phase \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-01-01"}'

Response

{
  "ok": true,
  "data": {
    "phaseName": "Waxing Gibbous",
    "illumination": 0.82
  }
}
POST/v1/datetime/calendar-invite1 credit / call

Calendar (.ics) invite builder

Build a standards-compliant iCalendar (.ics) meeting invite, with optional reminder, recurrence and attendees.

ParameterTypeRequiredDescription
titlestringYesEvent title.
datestringYesEvent date, YYYY-MM-DD, in the given time zone.
timestringYesEvent start time, HH:mm, in the given time zone.
durationMinutesnumberYesDuration in minutes.
timeZonestringYesIANA time zone, e.g. America/New_York.
locationstringNoEvent location.
meetingUrlstringNoVideo call URL.
descriptionstringNoEvent description.
organizerEmailstringNoOrganizer email address.
attendeesstringNoArray of attendee email addresses.
reminderMinutesnumberNoMinutes before start to remind. Omit for no reminder.
recurrencestringNonone | daily | weekdays | weekly | monthly | yearly. Default: none.
recurrenceCountnumberNoNumber of occurrences. Omit to repeat forever.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/calendar-invite \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"title":"Team sync","date":"2026-01-05","time":"09:00","durationMinutes":30,"timeZone":"America/New_York"}'

Response

{
  "ok": true,
  "data": {
    "result": "BEGIN:VCALENDAR..."
  }
}
POST/v1/datetime/world-clock1 credit / call

World clock

Current wall-clock time, UTC offset and day/night for any IANA time zone.

ParameterTypeRequiredDescription
timeZonestringYesIANA time zone, e.g. Asia/Tokyo.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/world-clock \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"timeZone":"Asia/Tokyo"}'

Response

{
  "ok": true,
  "data": {
    "time24": "09:00:00",
    "offsetLabel": "GMT+9"
  }
}
POST/v1/datetime/sunrise-sunset1 credit / call

Sunrise, sunset and solar noon

Approximate sunrise, sunset, solar noon and day length for a date and location (UTC instants).

ParameterTypeRequiredDescription
datestringYesDate, YYYY-MM-DD.
latitudenumberYesLatitude, -90 to 90.
longitudenumberYesLongitude, -180 to 180.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/sunrise-sunset \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-06-21","latitude":51.5,"longitude":-0.13}'

Response

{
  "ok": true,
  "data": {
    "dayLengthMinutes": 973
  }
}
POST/v1/datetime/dst1 credit / call

Daylight saving transitions

Find daylight-saving clock-change dates for an IANA time zone in a given year.

ParameterTypeRequiredDescription
timeZonestringYesIANA time zone, e.g. America/New_York.
yearnumberYesYear.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/dst \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"timeZone":"America/New_York","year":2026}'

Response

{
  "ok": true,
  "data": {
    "observesDst": true,
    "transitions": []
  }
}
POST/v1/datetime/time-in-words1 credit / call

Time in words

Spell a 24-hour clock time as a natural English phrase, e.g. "quarter past nine".

ParameterTypeRequiredDescription
hournumberYesHour, 0-23.
minutenumberNoMinute, 0-59. Default: 0.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/time-in-words \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"hour":9,"minute":15}'

Response

{
  "ok": true,
  "data": {
    "result": "quarter past nine"
  }
}
POST/v1/datetime/relative-time1 credit / call

Relative time formatter

Format the largest meaningful difference between a target date and comparison date.

ParameterTypeRequiredDescription
datestringYesTarget ISO date or date-time.
nowstringNoComparison ISO date or date-time. Defaults to the current time.
localestringNoBCP 47 locale. Default: en.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/relative-time \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-01-02T00:00:00Z","now":"2026-01-01T00:00:00Z"}'

Response

{
  "ok": true,
  "data": {
    "value": 1,
    "unit": "day",
    "formatted": "tomorrow"
  }
}
POST/v1/datetime/julian-day1 credit / call

Julian Day calculator

Convert an ISO date-time to Julian Day and Modified Julian Day.

ParameterTypeRequiredDescription
datestringYesISO-compatible date or date-time.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/julian-day \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2000-01-01T12:00:00Z"}'

Response

{
  "ok": true,
  "data": {
    "julianDay": 2451545,
    "modifiedJulianDay": 51544.5
  }
}
POST/v1/datetime/mayan-calendar1 credit / call

Mayan calendar converter

Convert a Gregorian date to Long Count, Tzolk'in and Haab values using the GMT correlation.

ParameterTypeRequiredDescription
datestringYesGregorian ISO date.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/mayan-calendar \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"date":"2012-12-21"}'

Response

{
  "ok": true,
  "data": {
    "longCount": "13.0.0.0.0"
  }
}
POST/v1/datetime/daylight-duration1 credit / call

Daylight duration calculator

Estimate daylight duration from latitude and date using solar declination.

ParameterTypeRequiredDescription
latitudenumberYesLatitude from -90 to 90.
datestringYesISO date.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/daylight-duration \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"latitude":28.6139,"date":"2026-10-01"}'

Response

{
  "ok": true,
  "data": {
    "daylightHours": 11.9,
    "formatted": "11h 54m"
  }
}
POST/v1/datetime/weather-season1 credit / call

Weather season calculator

Return the meteorological season for a month and hemisphere.

ParameterTypeRequiredDescription
monthnumberYesMonth from 1 to 12.
hemispherestringNonorthern | southern. Default: northern.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/weather-season \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"month":7,"hemisphere":"northern"}'

Response

{
  "ok": true,
  "data": {
    "meteorologicalSeason": "summer"
  }
}
POST/v1/datetime/business-days1 credit / call

Business days calculator

Count working days between dates or add/subtract working days with configurable weekends and holidays.

ParameterTypeRequiredDescription
startDatestringYesStart date, YYYY-MM-DD.
endDatestringNoEnd date for count mode.
amountnumberNoWorking days for offset mode.
directionstringNoadd | subtract. Default: add.
weekendDaysstringNoComma-separated weekday indexes (0=Sunday). Default: 0,6.
holidaysstringNoComma-separated YYYY-MM-DD dates.

Request

curl -X POST https://toolsonduty.com/api/v1/datetime/business-days \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"startDate":"2026-01-01","endDate":"2026-01-31"}'

Response

{
  "ok": true,
  "data": {
    "mode": "count",
    "businessDays": 22
  }
}