Skip to content

time.zones

the same moment in other time zones, and the time now around the world

The same moment as clocks read it in other time zones.

To show a date in another zone, write d to zone, where zone is UTC, local (your computer’s zone), a city or country name, or a name from the standard time zone list like “Asia/Tokyo” or “America/New_York”.

Zones follow daylight saving time on their own.

Tags: time

  • utc the same moment in UTC, the zone with no offset that times are often stored in
  • local the same moment in your computer’s time zone, the same as d to local
  • clock the time right now in each zone or city
1
# to UTC, or to local for your own zone
2
date("2026-12-25 18:30") to UTC2026-12-26 00:30:00 +00:00
3
# to a standard zone name
4
date("2026-12-25 18:30") to "Asia/Tokyo"2026-12-26 09:30:00 +09:00
5
# to a city or country
6
date("2026-12-25 18:30") to "Sao Paulo"2026-12-25 21:30:00 -03:00
7
# a zone in a variable needs parentheses
8
z = "Asia/Tokyo"; date("2026-12-25 18:30") to (z)2026-12-26 09:30:00 +09:00
Example outputCtrl+Enter to run
utc(d: date) -> date

the same moment in UTC, the zone with no offset that times are often stored in

Same as d to UTC

1
date(0) to UTC1970-01-01 00:00:00 +00:00
2
date(0).utc.year1970
Example outputCtrl+Enter to run

See also local, date

local(d: date) -> date

the same moment in your computer’s time zone, the same as d to local

1
(date(0) to UTC).local.year1969
Example outputCtrl+Enter to run

See also utc

clock(places: list) -> map / clock(place: str) -> date

the time right now in each zone or city

1
clock(["Tokyo", "London"]){Tokyo: 2026-11-05 03:12:40 +09:00, London: 2026-11-04 18:12:40 +00:00}
2
clock("Asia/Kolkata").hour >= 0true
Example outputCtrl+Enter to run

See also utc, local

1
# Christmas evening here, in Tokyo time
2
date("2026-12-25 18:30") to "Asia/Tokyo"2026-12-26 09:30:00 +09:00
3
# 5pm here is when in London?
4
5pm to "London"2026-11-04 23:00:00 +00:00
5
# world clock
6
clock(["Tokyo", "London", "New York"]){Tokyo: 2026-11-05 03:12:41 +09:00, London: 2026-11-04 18:12:41 +00:00, New York: 2026-11-04 13:12:41 -05:00}
Example outputCtrl+Enter to run

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.