Wednesday, October 5, 2011

Linux: get time in Indian Standard Time (IST)

On Any linux server, if you want to get time in the Indian standart time zone. use the following command

TZ='Asia/Kolkata' date 

For eg: TZ='Asia/Kolkata' date +%Y%m%d gives you 20111005

This is very useful if your server is on a different timezone and your applicaion(shell script) requires Indian Standard time (IST)

note: TZ=IST does not work since shell interpret it as International Standard Time





No comments:

Post a Comment