← Back to docs
endpoints
POST locci/geo/city/datetime/

Current local date and time for a given city.

Locci Geography

Overview

Returns the current local date and time for a given city. The response uses the city's associated IANA timezone name to compute the live datetime and returns it in multiple pre-formatted variants: 12-hour time with AM/PM, short date, full date, and individual components (year, month, day, hours, minutes, seconds). Also includes the city's GMT and DST offsets and the timezone abbreviation (e.g. PST, CET). Useful for building world clock displays or showing local time alongside astronomical event datetimes.


Request parameters

Name Type In Required Description Example
city_slug String Body Yes Slug of a city record. Obtain valid city slugs from the city list, nearest, or search endpoints.
is_coastal Boolean Body Optional

Response fields

Name Type Nullable Description Example
results Object Object containing city metadata and current local datetime in multiple formats.
results.city_id Integer Primary key of the city. 5969782
results.city_name String Name of the city. Victoria
results.city_slug String URL-friendly city name. victoria
results.current_date String Current date formatted as abbreviated weekday and month (e.g. Sat Jun 21 2025). Sat Jun 21 2025
results.current_datetime Datetime Full current datetime in the city's local timezone. 2025-06-21T14:32:00-07:00
results.current_day String Current two-digit day of the month (01–31). 21
results.current_hours String Current hour in 24-hour format (00–23). 14
results.current_minutes String Current minutes (00–59). 32
results.current_month String Current two-digit month (01–12). 06
results.current_seconds String Current seconds (00–59). 45
results.current_short_date String Current date as ISO 8601 (YYYY-MM-DD). 2025-06-21
results.current_time String Current time as 12-hour clock with seconds and AM/PM. 02:32:45 PM
results.current_year String Current four-digit year. 2025
results.timezone_code String Abbreviated timezone code at the current moment (e.g. PST or PDT). PDT
results.timezone_dst_offset String DST offset string prefixed with DST (e.g. DST-06:00). DST-06:00
results.timezone_formatted String Timezone name with underscores replaced by spaces. America/Vancouver
results.timezone_gmt_offset String UTC offset string prefixed with GMT (e.g. GMT-07:00). GMT-07:00
results.timezone_name String IANA timezone name for the city. America/Vancouver
results.timezone_slug String URL-friendly timezone name. america-vancouver