How can I find which time-zone is currently in effect on my system and get offset to it?
I need this information in order to offset some time calculations and I cannot make it constant because of daylight saving time (which effectively changes offset).
E.g. Currently my time-zone offset is +02:00 and it will be +01:00 during winter. I need to get which one it is and offset in hours (e.g. in this case answer should be 2).
I would need to do this in either tcsh or bash.
From command line it looks like time-zone isn't set (date "+%z" returns 0). However, from web interface time-zone is set to Europe/Zagreb. I would like to get offset to that time-zone.
Version of FreeNAS is 0.7 RC1.
Will give you the current timezone
Will give the offset from DST
FreeNAS runs on FreeBSD, so using http://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/ as a guide:
FreeBSD Setup Timezone
To setup corrct timezone you need to copy your timezone file from /usr/share/zoneinfo directory to /etc/localtime file. Just goto directory:
Use ls -l command to find out your zonefile.
For example I am in Asia/Culcatta (IST time zone) so I need to copy file as follows: