Getting numeric timezone on HP-UX


 
Thread Tools Search this Thread
Operating Systems HP-UX Getting numeric timezone on HP-UX
# 1  
Old 07-19-2012
Getting numeric timezone on HP-UX

Hi

I thought the UNIX command date is universal and so I have been using

date +%z to get the numberic timezone offset (e.g. -0500)

however on HP-UX, this is not returning expected results; on my machine it returns the name of the time zone (e.g. EST) not numbers.

does anyone know how to get the number timezone offset on HP-UX?

thanks for your help
# 2  
Old 07-19-2012
Is the TZ variable defined? That overrides the default file settings for timezones.

Check
Code:
/etc/timezone

it should be the setting for the current system timezone.

In HPUX the
Code:
/usr/lib/tztab

file has all of the settings for timezones. Check man tztab to learn how to set those to have offsets. I have not done HP-UX for loong time.
# 3  
Old 07-19-2012
thanks but my script will be running across various HPUX systems, I don't think I have the ability to set the timezone per each system.

is there no universal numeric timezone offset in HPUX?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

TIMEZONE problem..

hii there... can you guys help me with TIMEZONE setting on my solaris box i tried to edit cat /etc/TIMEZONE..but i think it will work after rebooting, but something i did which took me to GMT my problem is i have this issue on a server, and i have to fix this without rebooting. thanks for... (1 Reply)
Discussion started by: 6pound
1 Replies

2. UNIX for Dummies Questions & Answers

Find and Replace random numeric value with non-numeric value

Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is: 1702938475,SNU022,201004 the first 10 numbers always begin with 170 (6 Replies)
Discussion started by: Bahf1s
6 Replies

3. Red Hat

changing timezone

Hi, I would like to change time zone Linux from IST to US/Canada but not getting the option , I have run the command setup -> timezone configuration but not getting the option of us/canada or pacific us/canada. Please suggest. Regards, Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies

4. Shell Programming and Scripting

Help with timezone conversion

Hi, Date_ConvTZ of module Date:Manip, converts time zone to specified server but without day time savings... $mod = Date_ConvTZ($date,"$thisTZ","$serverTZ"); US and UK timezone difference is 5 hrs, but above function will return difference of 4 hrs. Please help (1 Reply)
Discussion started by: darshakraut
1 Replies

5. Solaris

Timezone query

Hi Everyone, We have Solaris server which displays the time in CET and our application is used across the globe.(Users are in singapore, poland, US). At present in order to display Timezone we are manually manupulating time based on country in a enviromental file. I want to know , do we... (2 Replies)
Discussion started by: gehlnar
2 Replies

6. Shell Programming and Scripting

Perl code to differentiate numeric and non-numeric input

Hi All, Is there any code in Perl which can differentiate between numeric and non-numeric input? (11 Replies)
Discussion started by: Raynon
11 Replies

7. UNIX for Advanced & Expert Users

Timezone

HI ; I got Solaris8 installed oon Sunfire V440 .I have TZ=GMT in /etc/TIMEZONE , but when i log in as root i see the date in GMT+1. So i have every time to "set TZ=GMT ; export $TZ" . How can i set the TZ=GMT at the startup defenitely. Thanks :) (7 Replies)
Discussion started by: oss
7 Replies

8. UNIX for Dummies Questions & Answers

timezone

Hi, i am searching to change the timezone on a HP-UX11 system. Since last weekend the summertime started i am not able to change the time to the new time, every day the time changes back to wintertime. I think the problem is that the server is on the wrong timezone. Can someone help me please?... (1 Reply)
Discussion started by: eddyvdv
1 Replies

9. UNIX for Dummies Questions & Answers

Timezone

Hi, I got an question about changing timezone thrue command line on a SunOS Release 4.1.2 without restarting the computer. Now it's set on WET and I want to set the timezone to CET (GMT +1) Plz somebody help me. Regards Novisern:confused: (5 Replies)
Discussion started by: Novisern
5 Replies

10. UNIX for Dummies Questions & Answers

Timezone

Hello again, under hp-ux i have a file /etc/TIMEZONE. here is definied which timezone i am. i dont know who reads this file to set after reading the timezone under /usr/lib/tztab. my 2 questions, who reads the file /etc/TIMEZONE ( which service ) and do i need in the first line to set my... (6 Replies)
Discussion started by: ortsvorsteher
6 Replies
Login or Register to Ask a Question