I am using Colibri-imx6 with Linux OS. I am trying to set timezone to Detroit using timedatectl.
The command I use timedatectl set-timezone America/Detroit . I am not able to set the timezone. I get the following error
Failed to set time zone: Invalid time zone ‘America/Detroit’
I am able to set the timezone by creating a symlink. However the zoneinfo has very limited timezones.
Is there any other way to set timezone through user program ? I tried setting the tz environment variable but it resets the time to system time once the program execution is over.
We do not install the timezone databases in our demo images. Unfortunately the list of potentially available timezones is known to timezone utilities, so you may get the impression that you can use America/Detroit while in fact the required data file is not available.
You could add tzdata-americas (or tzdata for all data) to your image and rebuild the image if you are using a Yocto setup.
Alternatively you could install it with:
Add the package to the IMAGE_INSTALL variable, e.g. have a look here.
Note that the package name is the first part of the ipk file name up to the first ‘_’. E.g. in your example this would be tzdata-europe.