Skip to content

balena-io-examples/balena-timezone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

balena-timezone

NOTE: This project is aimed at setting the container's timezone, as typically that is all that is required.

To set the timezone, find the name of your timezone in the /usr/share/zoneinfo directory (see info), or from Wikipedia (the TZ column), and set an environment variable called TZ with that value, either in the Dockerfile (hardcoded) by ENV TZ <value> or a new variable called TZ in the dashboard.

For example set TZ to Europe/London to follow the London time, or Asia/Tokyo if you are in Tokyo, etc. For reference projects, check Inkyshot's timezone customisation.

This will set the container's timezone to whichever timezone you have chosen. All balena.io devices use the UTC timezone by default, for logs, timing, etc. This project gives an minimal example of how to set the device timezone within your application if required. This will only work if tzdata package is installed in the container image. Refer to Time Management section of the balenaOS documentation for more information.

If you want to use this example in your project, add your application's own start to the marked section in the start script.

About

Example of how to set the timezone within a container

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages