- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- difference between 2 timestaps
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
06-12-2003 06:09 AM
06-12-2003 06:09 AM
I look for a program or a function, me permitted to calculate like many time between two time stamps past.
Thank you for her assistance
M.Weller
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2003 04:05 PM
06-12-2003 04:05 PM
SolutionI have made the calculations in two ways,
one with awk, the other one with shell script, remove not wanted option.
if you name the script d_t (diff time) you could type the following:
./d_t "06/13/2003 10:00:00" "06/14/2003 12:10:10"
and the result will be:
Calculation in awk -----------------
Diff time in seconds: 94210
Diff time in minutes: 1570.167
Diff time in hours: 26.169
Diff time in days: 1.090
Calculation in shell ---------------
Diff time in seconds: 94210
Diff time in minutes: 1570
Diff time in hours: 26
Diff time in days: 1
hope this helps.
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2003 10:59 PM
06-12-2003 10:59 PM
Re: difference between 2 timestaps
I read 'date -d' in the script.
My date commando doesn't accept '-d' option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2003 11:07 PM
06-12-2003 11:07 PM
Re: difference between 2 timestaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 04:54 AM
06-13-2003 04:54 AM
Re: difference between 2 timestaps
In fact at this moment i don't know if date -d works in HP-UX, i answer in linux forum and hp-ux forum too, so perhaps i checked this script in linux where "date -d" is correct.
I will check it in HP-UX and i will tell you the result.
Regards.
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:22 AM
06-13-2003 05:22 AM
Re: difference between 2 timestaps
You are correct, HP-UX date does not support -d option, to solve this problem you can go to:
http://hpux.connect.org.uk/hppd/hpux/Gnu/sh_utils-2.0/
where are the gnu sh-utils, install it and you get the right date command version for HP-UX and my script.
Regards.
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 05:41 AM
06-13-2003 05:41 AM
Re: difference between 2 timestaps
Chris