Skip to content

New Share your ideas with the AWTRIX community. Keep your creations together in your account.

Sign in

Which AWTRIX do you have? Choose it once and the Hub shows what runs on it.

ScriptAWTRIX NG

worldclock

On an AWTRIX display
worldclock shown on an AWTRIX display
worldclock · by caoshijun

On your display

A world clock that rotates through your own time zones, with DST support and 10 built-in transition animations. One app, no network needed.

Which AWTRIX do you have? See below where it runs, or choose your device.
Topic
Miscellaneous
Includes
Script

Runs on

  • Runs on 32×8 (TC001 & DIY)
  • Runs on 52×16 (TC002)
  • Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.

Choose your display in the next step.

Send to AWTRIX

Choose your AWTRIX

worldclockAWTRIX NG script

Install this script on your AWTRIX NG. Its icons and sounds are installed with it.

Your AWTRIX’s local address, for example 192.168.178.39 or awtrix.local.

The name shown in your AWTRIX script list. Use letters, digits, hyphens or underscores.

Connection & device login

Connect your phone or computer to the same network as your AWTRIX. Allow local network access if your browser asks.

Use the device’s IP address, without a page path such as /#/apps.

If your AWTRIX requires a login, the username and password fields will appear when you connect.

Sign in to the Hub to install scripts. Attached files are installed separately.

Script description

WorldClock shows the current time in several places, one after another, on the 32×8 display. It is a single Berry script: it takes one turn in the AWTRIX rotation, and inside that turn it cycles through this clock and up to five cities of your choice.
Features
• This clock plus up to 5 cities. Each city has its own name (up to 4 characters), UTC offset and DST rule. This clock is shown first and has a name of its own (default HOME).
• Automatic daylight saving time. Choose none, us, eu or au per city. The script works out the switch dates for the current year, so you never have to change offsets by hand.
• Any UTC offset. Quarter-hour steps are supported (for example 5.5 for India or 5.75 for Nepal).
• 24-hour or 12-hour format.
• 10 transition animations between cities: push_left, push_right, push_up, push_down, cover, fade, shutter, blinds, dissolve and wipe. Pick one, let cycle use a different one on every change, or choose none for an instant switch.
• Day marker. A pixel in the top-right corner is green when a city is already on the next day compared with this clock, and red when it is still on the previous day.
• Rotation dots. The bottom row shows one dot per city; the current city is lit in its own color.
• Select button. Press the middle button to jump to the next city.
• Small and gentle on memory. The script is about 7.2 KB, uses no icons and no network, and rebuilds its text only once a minute.
Good to know
• Each city's turn lasts the configured number of seconds. One turn of the app shows every city once.
• If a name and the time do not fit together in 32 pixels, the name is dropped and only the time is shown. Short names (3 characters) and the 24-hour format fit best.
• Supported DST rules: us (second Sunday of March to first Sunday of November), eu (last Sunday of March to last Sunday of October) and au (southern hemisphere, first Sunday of October to first Sunday of April). Other rules are not built in; for those, choose none and adjust the offset yourself.
• Text uses the built-in fonts, so use Latin letters and digits for names.
Setup
Requirements
• A clock running AWTRIX NG.
• The script fits the default size limit of 8 KB (scriptMaxBytes). No icons, no Hub dependencies, no internet access.
Install

  1. Open the web UI of your clock and go to the Scripts tab.
  2. Press + and type WorldClock into the name field.
  3. Paste the contents of WorldClock.be into the editor.
  4. Press Save (or Ctrl-S), then Show on the clock.
  5. Go to the Apps tab and press the gear icon on the WorldClock row to configure it.
    Settings
    Group
    Setting
    Default
    What it does
    This clock
    UTC offset (standard)
    -8
    UTC offset of the place where the clock stands, in standard (non-DST) time.
    This clock
    DST
    us
    DST rule of that place: none, us, eu or au.
    This clock
    Name
    HOME
    Name shown for this clock. Leave it empty to hide this clock from the rotation.
    Display
    Seconds per city
    4
    How long each city is shown (1 to 30).
    Display
    24-hour
    on
    Switch off for 12-hour time with a/p.
    Display
    Transition
    cycle
    Animation between cities (see above).
    Display
    Transition ms
    600
    Animation length, 100 to 2000 ms. It is limited to half of the city time.
    City 1 to 5
    On
    City 1-3 on, 4-5 off
    Switch a city on to add it, off to remove it.
    City 1 to 5
    Name
    UTC, YVR, BJ, LON, NYC
    Up to 4 characters.
    City 1 to 5
    UTC offset
    0, -8, 8, 0, -5
    Standard-time offset in hours.
    City 1 to 5
    DST
    none, us, none, eu, us
    DST rule of that city.
    Important
    • Set the "This clock" offset and DST rule first. The script reads the clock's local time from AWTRIX and needs to know which time zone that is, so that it can work out the other cities. The defaults assume Vancouver (UTC-8 with US daylight saving time).
    • Enter standard-time offsets. For example, New York is -5 with DST rule us; do not enter -4 in summer.
    • Saving the settings restarts the app. This is normal.
    Troubleshooting
    • A city does not appear: check that its On switch is enabled. The dots in the bottom row show how many cities are in the rotation.
    • A city shows the time but no name: the name and the time do not fit in 32 pixels. Use a shorter name or the 24-hour format.
    • The display shows --:--: the clock has not received the time yet. It appears within a few seconds once the clock is connected.
    • The wrong hour is shown: check the offset and DST rule under This clock first, then the city's own settings.
    • The display shows ERR: in red: the message is shown next to the script on the Scripts tab. Fix the line it names and save again.
    • Install is refused (507): restart the clock, delete a script you do not use, and try again.

More scripts in Miscellaneous

Something wrong with this script? Report it.