- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Convert system time to any other Time zone time
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2004 11:57 AM
10-07-2004 11:57 AM
Convert system time to any other Time zone time
Is there any way in hp-ux to Convert system time to any other Time zone time.
say local time to IST,GMT,etc.
THX
sanjeevg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2004 12:07 PM
10-07-2004 12:07 PM
Re: Convert system time to any other Time zone time
Time zone setting is only for the interpretation of the time. HP-UX maintains it's time always in GMT.
YOu can change the timezone setting by modifying /etc/TIMEZONE file and then login again. However, if changing of TIMEZONE affects your application, you will need to bring it down prior to changing the time. All the 'login' sessions and their child processes will have to be closed. I have seen some primitive applications merely depending on the date and time without counting timezone. For ex., a script that uses a simple 'date' command to get the hour and minute information for calculations may produce wrong results if you change the timezone. So, it is a good idea to reboot the system (or atleast restart your apps) if you are planning to change the timezone.
'set_parms timezone' is HP's supported command to change the timezone.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2004 12:09 PM
10-07-2004 12:09 PM
Re: Convert system time to any other Time zone time
You need to set the TZ variable to the approriate time zone.
Are you looking to set the time zone permanently or for use in any other scripts/programs ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2004 12:16 PM
10-07-2004 12:16 PM
Re: Convert system time to any other Time zone time
Actually the case is this that i have a file in which i have records of different servers( located at different time zone) in front of that record i have local system time, now i want to convert this local time to that specific time zone time. is there any way to convert it as i am not allowed to do ssh like thing to pick date from that server.
pl. guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2004 02:23 PM
10-07-2004 02:23 PM
Re: Convert system time to any other Time zone time
The only practical way to fix this is at the remote site. When you create the file, change the TZ value to your central server's TZ value and then get the date, like this:
MYDATE=$(TZ=EST5EDT;date)
or
MYDATE=$(TZ=PST8PDT;date)
Now the remote machine can store the central server's timestamp locally.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2004 08:01 AM
10-08-2004 08:01 AM
Re: Convert system time to any other Time zone time
can i convert my sytem time to seconds and again convert seconds to system time
thx
sanjeev gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2004 08:15 AM
10-08-2004 08:15 AM
Re: Convert system time to any other Time zone time
Epoch seconds:
perl -e 'print time'
1097266110
To convert epoch seconds back to a formatted time:
TZ=EST5EDT perl -e 'print scalar localtime(1097266110)'
Fri Oct 8 16:08:30 2004
Man perlfunc and note gmtime, localtime, time for more details.