Linux machines use UTC clock so does bash script, If your script needs time from a different timezone then you have to convert current UTC to let's say PDT, how do we do it in bash.
Python has widely used programing language and has lots of libraries for this, But funny this is bash very answer for this, just export TZ variable. As simple as this.
Let's try this snippet on a Linux machine. It prints time from 3 timezones PDT, UTC, and IST.
0 Comments