How To Use Etc Localtime
To dual boot with windows it is recommended to configure windows to use utc rather than linux to use localtime.
How to use etc localtime. Check the current timezone using etc localtime file. Root kerneltalks ll etc localtime lrwxrwxrwx. 1 root root 35 jan 16 22 10 etc localtime usr share zoneinfo europe oslo. Let us see some examples to change timezone or set a new time zone on a centos linux. You would like to change this to pacific.
Use one of the following methods to change the timezone on your linux system. Open regedit and add a dword value for 32 bit windows or qword for 64 bit one with hexadecimal value 1 to the registry. Root oradbfw hq01 mgmt date mon sep 11 09 29 27 utc 2017 on many distributions like oel centos. 1 log on to the linux server and switch user to root execute the date command to find the current time date and time zone of the linux server. Etc localtime it is a symlink to the file localtime or to the correct timezone file in the system located in usr share zoneinfo directory.
Assume we have timezone utc. Windows by default uses localtime. The timezone is conntrolled by localtime file located in etc directory. The c library function struct tm localtime const time t timer uses the time pointed by timer to fill a tm structure with the values that represent the corresponding local time. Change timezone using etc localtime file.
Struct tm localtime const time t timer. If you check your current file its a soft link to respective timezone file in usr share zoneinfo directory. Following is the declaration for localtime function. Cd etc localtime is a symbolic link so we can remove it rm localtime all timezones are located under. Date mon feb 18 18 40 10 ist 2019.
For this example assume that your current timezone is utc as shown below. One of these methods should work for you depending on the linux distribution you are using. Where localtime is a soft link to the zone file located under usr share zoneinfo region. The timezone information is universally kept under etc localtime. Etc localtime is the file used by the kernel to determine the timezone.