Alex Rivera | Logout

Can I get UTC offset from Unix command line?

Asked 2011-05-02T16:33:55.510
20

I'm writing an autoconf script that needs the current UTC offset. There's no obvious way to get this out of the date program. Is there any straightforward way to get this from a command-line utility, or should I write a test that gets the information and somehow captures it?

Edit
Report

1 Answer

34

Try this, and see whether it works for you:

date +%z
answered 2011-05-02T16:38:58.613

Your Answer