Aller au contenu

Changing the time zone in the Linux shell

Ce contenu n’est pas encore disponible dans votre langue.

By default, a Linux shell uses the host server’s time zone. If you are in a different time zone, you can override this setting with TZ.

The TZ environment variable affects file and directory timestamps as well as the output of the date command. For example, to set the time zone to Lagos, Nigeria:

Terminal window
export TZ="Africa/Lagos"

To make this change permanent for future logins, add the line above to your ~/.bash_profile or ~/.bashrc file.

For a complete list of time zones, visit:
Wikipedia: List of tz database time zones

Cette page vous a-t-elle aidé ?