- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- getting UNIX epoch 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
09-28-2006 01:08 AM
09-28-2006 01:08 AM
getting UNIX epoch time
I'm attempting to obtain the UNIX epoch time(since 1970) on a HPUX machine. I've tried with the 'truss' utility i.e.
/usr/bin/truss /usr/bin/date 2>&1|/usr/bin/awk '/time/ {print $NF}'
1159448101
On a GNU platform, I could do:
mz[t1]$ date '+%s'
1159448106
Unfortunately, I do have the GNU date/utilities installed on my HPUX-11 machine.
May I know what is the more effecient or simple way to obtain the UNIX epoch time, instead of using the truss?
Thanks
Danny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2006 01:12 AM
09-28-2006 01:12 AM
Re: getting UNIX epoch time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2006 01:12 AM
09-28-2006 01:12 AM
Re: getting UNIX epoch time
use Perl;
# perl -le 'print time'
# perl -le 'print scalar localtime(time)'
# perl -le 'print scalar localtime(86400)'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2006 06:36 PM
09-28-2006 06:36 PM
Re: getting UNIX epoch time
2001 Jul 18 15:16:37
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2006 11:22 PM
09-28-2006 11:22 PM
Re: getting UNIX epoch time
With regards to your solution posted below,
echo "0d995462197=Y" | adb
2001 Jul 18 15:16:37
could you explain what does the "0d995462197=Y" value mean when passed to the debugger?
Thanks
Danny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2006 06:47 AM
10-01-2006 06:47 AM
Re: getting UNIX epoch time
Passing "0d995462197=Y" to the debugger ('adb') says to take the *decimal* (0d) number (995462197) and convert it to a time_t object. This is documented in the 'adb' manpages:
http://www.docs.hp.com/en/B2355-60105/adb.1.html
Regards!
...JRF...