Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/balena-io-examples/balena-timezone
Example of how to set the timezone within a container
https://github.com/balena-io-examples/balena-timezone
Last synced: 22 days ago
JSON representation
Example of how to set the timezone within a container
- Host: GitHub
- URL: https://github.com/balena-io-examples/balena-timezone
- Owner: balena-io-examples
- License: apache-2.0
- Created: 2016-08-04T02:20:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-01T11:17:05.000Z (over 3 years ago)
- Last Synced: 2024-05-29T22:15:27.735Z (7 months ago)
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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](https://wiki.debian.org/TimeZoneChanges)), or from
[Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)
(the TZ column), and set an environment variable called `TZ` with that
value, either in the Dockerfile (hardcoded) by `ENV TZ ` or a new
variable called `TZ` in the [dashboard](https://docs.balena.io/management/env-vars/).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](https://github.com/balenalabs/inkyshot#timezone).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](https://www.balena.io/docs/reference/OS/time/) 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](./start.sh).