Reputation: 117
I have system time in PDT timezone in my CentOS machine but I want my bash prompt to display IST time without changing the system time. How can I set my PS environment variable to do that?
Upvotes: 3
Views: 1163
Reputation: 364
PS1="[\$(TZ='Asia/Kolkata' date '+%F %T %Z') \u@\h \W]\n\$ "
\$(TZ='Asia/Kolkata' date '+%F %T %Z')
returns current time in IST.
Ref.: http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
Upvotes: 5