Let date output the english in Ubuntu


為何會需要將date輸出的結果改成英文,是為了方便產生build code的時間資訊

Check the default locale in Ubuntu
$ locale -a

找類似於 en_US 的locale全名,我的是en_US.UTF-8

Set your local environment variable
~/.bashrc
export LC_TIME=en_US.UTF-8

Test the result
$ source ~/.bashrc
$ date

If you want to set in the global environment vairable
$ sudo vim /etc/default/locale
or
$ sudo vim /etc/environment

Reference:
http://www.davidpai.tw/ubuntu/2011/ubuntu-set-locale/

留言