Skip to content
POST/api/astro/date_time/1 credit

Time zone resolver

Turns a wall-clock birth time and a pair of coordinates into an unambiguous instant. Every other endpoint here wants either a timezone-aware timestamp or a numeric UTC offset, and getting that wrong is the commonest cause of a chart that is quietly an hour or a day out, so this is usually the first call you make. Send `date`, `time`, `latitude` and `longitude`. The coordinates are resolved to an IANA time zone, the naive date and time are read in that zone, and you get back `input_datetime`, the resolved `timezone` name, `localized_datetime` with its offset attached, and `utc_datetime`. Feed the localised value straight into `date_time` elsewhere. One caveat: the request field is spelt `use_LMT` but the view reads a differently-spelt name, so local mean time is never actually applied and the IANA zone is always used — `use_lmt` in the response is always false. For births before standard time was adopted locally, work out the local mean time offset yourself (four minutes per degree of longitude) rather than relying on this flag.

https://yogataraapi.prahlad.app/api/astro/date_time/
Test Request

Authentication

Send your key in the X-API-Key header. Keys are server-side credentials — never put one in browser JavaScript or a mobile app.

X-API-Key: yt_live_a1b2c3d4_…
Content-Type: application/json

Request fields

FieldTypeRequiredNotes
datestring (date)required

FORMAT constraint, not an enum. DRF DateField with default input formats = ISO-8601 only: 'YYYY-MM-DD'.

latitudenumber (double)required

Latitude of the place, in decimal degrees. Positive is north, negative is south. Example: 26.9124 for Jaipur, 40.7128 for New York. Minutes and seconds are not accepted - convert first.

min -180 · max 180

longitudenumber (double)required

Longitude of the place, in decimal degrees. Positive is east, negative is west. Example: 75.7873 for Jaipur, -74.0060 for New York. Note the sign: a missing minus puts New York in China.

min -180 · max 180

timestring (time)required

FORMAT constraint, not an enum. DRF TimeField with default input formats = ISO-8601 only: 'HH:MM', 'HH:MM:SS' or 'HH:MM:SS.ffffff'. The catalogue sample value "string" is misleading.

use_LMTbooleanoptional

Example request

curl -X POST https://yogataraapi.prahlad.app/api/astro/date_time/ \
  -H "X-API-Key: $OCCULT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"1980-09-05","time":"04:42:05.037Z","longitude":80,"latitude":23,"use_LMT":true}'

Response

{
  "input_datetime": "1980-09-05 04:42:05",
  "latitude": 23,
  "longitude": 80,
  "timezone": "Asia/Kolkata",
  "use_lmt": false,
  "localized_datetime": "1980-09-05T04:42:05.037000+05:30",
  "utc_datetime": "1980-09-04T23:12:05.037000+00:00"
}

Captured from a real call using the exact request above. Results sit under data.

Errors

Metering errors return { "error": "…", "message": "<code>", "is_error": true }. Show error to people and branch on message. See the error reference.