LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   TZ value question (https://www.linuxquestions.org/questions/linux-newbie-8/tz-value-question-4175498678/)

ilesterg 03-19-2014 12:06 AM

TZ value question
 
Hi all,


Can you please help me understand the meaning of the following?

export TZ=CET0EDT

I have an ongoing investigation where a script echoes the date, but there is some kind of inconsistency since the value in the date is correct, but the lable is EDT for some reason. Can this be the cause of that? I saw the code in the .profile of the user.

Thanks!

unSpawn 03-20-2014 05:13 PM

Please don't mark threads "solved" if they aren't. Date reads /etc/localtime and a user shouldn't (need to) specify TZ unless a value different than local time is required. I actually never encountered a "${TZ0}0${TZ1}" setting nor do I have an idea why that would work or be required?..
Post the script and its output?

ilesterg 03-20-2014 06:29 PM

Hi,

Thanks. It turns out the script makes use of its own TZ value to be displayed in its output instead of the system/local time. I don't see why it's required either. I just played with TZ in a command line and saw this
Code:

awesomeuserserver:awesomeuser /home/awesomeuser>export TZ=CET0EDT
awesomeuserserver:awesomeuser /home/awesomeuser>date
Thu Mar 20 00:17:45 EDT 2014
awesomeuserserver:awesomeuser /home/awesomeuser>export TZ=CET0CET
awesomeuserserver:awesomeuser /home/awesomeuser>date
Thu Mar 20 00:17:55 CET 2014
awesomeuserserver:awesomeuser /home/awesomeuser>export TZ=CET0MMM
awesomeuserserver:awesomeuser /home/awesomeuser>date
Thu Mar 20 00:18:02 MMM 2014
awesomeuserserver:awesomeuser /home/awesomeuser>unset tz
awesomeuserserver:awesomeuser /home/awesomeuser>

I made a lazy conclusion that the part after 0 would translate to the label and the one before 0 is the actual date.

Cheers!


All times are GMT -5. The time now is 06:33 PM.