Chuyển đến nội dung chính

Change Timezone in CentOS | Thay đổi múi giờ trong CentOS

Timezone of VietNam is Asia/Ho_Chi_Minh. To change default timezone in centos, follow this struction.
 
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime

Type date in terminal and you will see time in Viet Nam

In Linux, the system time zone is determined by the symbolic link /etc/localtime . This link points to a time zone data file that describes the local time zone. The time zone data files are located at either /usr/lib/zoneinfo or /usr/share/zoneinfo depending on what distribution of Linux you use.
For example, on a SuSE system located in New Jersey the /etc/localtime link would point to /usr/share/zoneinfo/US/Eastern . On a Debian system the /etc/localtime link would point to /usr/lib/zoneinfo/US/Eastern .
If you fail to find the zoneinfo directory in either the /usr/lib or /usr/share directories, either do a find /usr -print | grep zoneinfo or consult your distribution's documentation.
What happens when you have a users located in a different timezone? A user can change his private time zone by setting the TZ environment variable. If it is unset, the system time zone is assumed. The syntax of the TZ variable is described in the tzset manual page.
The date command shows the current date and time. For example:

  
 $ date
 Sun Jul 14 21:53:41 EET DST 1996
 $ 
That time is Sunday, 14th of July, 1996, at about ten before ten at the evening, in the time zone called ''EET DST'' (which might be East European Daylight Savings Time). date can also show the universal time:

  
 $ date -u
 Sun Jul 14 18:53:42 UTC 1996
 $ 
date is also used to set the kernel's software clock:

  
 # date 07142157
 Sun Jul 14 21:57:00 EET DST 1996
 # date
 Sun Jul 14 21:57:02 EET DST 1996
 # 
See the date manual page for more details; the syntax is a bit arcane. Only root can set the time. While each user can have his own time zone, the clock is the same for everyone.
Beware of the time command. This is not used to get the system time. Instead it's used to time how long something takes. Refer the the time man page.
date only shows or sets the software clock. The clock commands synchronizes the hardware and software clocks. It is used when the system boots, to read the hardware clock and set the software clock. If you need to set both clocks, you first set the software clock with date , and then the hardware clock with clock -w .
The -u option to clock tells it that the hardware clock is in universal time. You must use the -u option correctly. If you don't, your computer will be quite confused about what the time is.
The clocks should be changed with care. Many parts of a Unix system require the clocks to work correctly. For example, the cron daemon runs commands periodically. If you change the clock, it can be confused of whether it needs to run the commands or not. On one early Unix system, someone set the clock twenty years into the future, and cron wanted to run all the periodic commands for twenty years all at once. Current versions of cron can handle this correctly, but you should still be careful. Big jumps or backward jumps are more dangerous than smaller or forward ones.

Nhận xét

Bài đăng phổ biến từ blog này

Windows 10 enable long file/folder path

Windows 10 enable long file/folder path Registry Import Enabling Long Paths Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\FileSystem] "LongPathsEnabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] "LongPathsEnabled"=dword:00000001 Enable via group policy editor Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> FileSystem -> Double click Enable Win32 long paths and select Enabled

Tạo đĩa cứu hộ DLCD chuẩn UEFI

Chạy CMD dưới quyền quản trị (admin), nếu như bạn đang sử dụng Windows 8 trở lên thì nhấn tổ hợp phím “Windows + X” và chọn “Command Prompt (Admin)” Cửa sổ “Command Prompt” hiện ra bạn gõ lệnh  DISKPART  > gõ tiếp lệnh  LIST DISK  để nó liệt kê ra toàn bộ ổ cứng của bạn. Tạo usb chuẩn UEFI chứa bộ cài Windows Ví dụ như trong hình thì Disk 1 là USB và Disk 0 sẽ là ổ cứng, bạn nhìn vào dung lượng (Size) để biết được chính xác đâu là Disk của usb nhé. + Sau khi bạn đã biết được chính xác đâu là DISK của USB thì gõ tiếp lệnh  SELECT DISK   x  (x là số DISK của USB). Ví dụ như trong hình trên, mình sẽ gõ chính xác dòng lệnh như sau:  SELECT DISK 1 Các bạn làm theo chính xác các lệnh sau: CLEAN – Lệnh này sẽ xóa sạch dữ liệu trên ổ bạn đã chọn (ơ đây là USB). CON GPT – Lệnh này sẽ chuyển sang định dạng GPT. CREATE PARTITION PRIMARY – Lệnh này sẽ tạo Partion cho toàn bộ ổ đĩa mà bạn đã lựa chọn. FORMAT QUICK...

Xcode 8 support devices ios 7

Tải XCode 5.1.1 về, copy 2 folder 7.0 & 7.1 trong thư mục /Volumes/Xcode/ Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport sang thư mục DeviceSupport của phiên bản XCode 8 (hiện tại) Mở file SDKSetting.plist trong thư mục /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk Thêm giá trị 7.0 & 7.1 vào key Root->DefaultProperties->DEPLOYMENT_TARGET_SUGGESTED_VALUE Thoát XCode & khởi động lại XCode