What the API expects
Every birth input carries tz_offset_minutes: an integer from -840 to 840, east-positive - India is 330, New York in winter is -300. The engine turns the local wall-clock time into Universal Time with exactly one subtraction, UT = local time - tz_offset_minutes / 60, rolling the date when the result leaves 0-24 h. There is no time-zone name, no DST flag and no second chance: whatever offset you send is the one the chart is cast for.
The output of this tool drops straight into a request:
{
"date": "1942-09-01",
"time": "12:00:00",
"tz_offset_minutes": 390,
"lat": 19.0728,
"lng": 72.8826
}How the offset is resolved
The city search returns coordinates and an IANA zone (such as Asia/Kolkata) from an offline gazetteer of about 135,000 places, with the zone looked up from the coordinates. The offset is then computed from the IANA time-zone database in two passes: first read the offset as if the wall-clock time were UTC, then re-read it at the instant that offset implies. The second pass is what makes dates near a daylight-saving change come out right.
This is the same function the playground uses, ported line-for-line from the geocoder behind AstroNode's chat API, so a city chosen here resolves to the coordinates and offset the API's own chat flow would use.
Offsets that are not today's
| Zone and local time | tz_offset_minutes | Why |
|---|---|---|
| Asia/Kolkata, 1942-09-01 12:00 | 390 | Wartime clocks ran an hour ahead of +5:30 |
| Asia/Kolkata, 1900-01-01 12:00 | 321 | Pre-standard local mean time, rounded to whole minutes |
| Asia/Kathmandu, 1980-01-01 12:00 | 330 | Nepal moved to +5:45 (345) later |
| Asia/Dhaka, 2009-06-20 12:00 | 420 | Bangladesh's 2009 daylight time; 360 in 1990 |
| Europe/London, 1970-12-01 12:00 | 60 | UK clocks stayed on +1 that winter (British Standard Time) |
| America/New_York, 2024-07-04 12:00 | -240 | Daylight time; -300 in January |
Historical offsets come from the IANA database bundled with your browser, which is the same family of data the server-side geocoder uses. Very old local-mean-time values are not whole minutes; since the API only accepts integers, they are rounded to the nearest minute.
Clock changes: skipped and repeated hours
On the night clocks go forward, an hour of local times never happens; on the night they go back, an hour happens twice. The two-pass method resolves a skipped time to the offset after the change (America/New_York, 2024-03-10 02:30 gives -240) and a repeated time to its first occurrence (2024-11-03 01:30 gives -240, daylight time). The tool flags any time within an hour of a change so you can check the source record.
Common mistakes
- Using today's offset for every date. The single most common source of a wrong ascendant. Resolve the offset for the birth date, not for now.
- West-positive offsets. JavaScript's
Date.getTimezoneOffset()returns-330for India. The API wants330. Negate it - or better, do not use the runtime's zone at all, since that is the server's or the user's device zone, not the birthplace's. - Hours instead of minutes.
5.5fails validation;330is right. Offsets must be integers. - Resolving the offset in UTC. The offset depends on the LOCAL wall-clock time; feed the birth time as the user wrote it.
- Storing only the offset. Keep the city, coordinates and IANA zone too, so the offset can be recomputed if the time-zone database corrects a historical rule.
FAQ
- Does the API accept an IANA zone name instead of an offset?
- No. The birth input takes exactly
date,time,tz_offset_minutes,latandlng, and rejects unknown fields with400 VALIDATION_ERROR. Resolve the zone to an offset on your side - this tool shows the method. - What range of offsets is valid?
- Integers from -840 to 840 minutes (UTC-14:00 to UTC+14:00), east of Greenwich positive.
- Is the city search sending my data to the API?
- The city box queries this website's own gazetteer route for matching place names. The offset arithmetic runs in your browser, and nothing is sent to the AstroNode API.
- Why does an old date give an odd value like 321?
- Before standard time zones, places kept local mean time, which is rarely a whole number of minutes from UTC. The API needs an integer, so the value is rounded to the nearest minute.