- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: TIME Difference command??
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
Discussions
Discussions
Forums
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
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-19-2003 02:45 PM
тАО10-19-2003 02:45 PM
TIME Difference command??
Is there a command in unix which computes time differece . example date/time1 - date/time2.
format of date time is same output of date commmand ex.
Mon Oct 20 14:22:52 EAT 2003
Hope you could help me with this. thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2003 03:02 PM
тАО10-19-2003 03:02 PM
Re: TIME Difference command??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2003 04:46 PM
тАО10-19-2003 04:46 PM
Re: TIME Difference command??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2003 04:51 PM
тАО10-19-2003 04:51 PM
Re: TIME Difference command??
No such command in unix. May be you can write a script to do that. OR convert dates to to epoc(seconds since 1970) and compare.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2003 07:17 PM
тАО10-19-2003 07:17 PM
Re: TIME Difference command??
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2003 08:44 PM
тАО10-19-2003 08:44 PM
Re: TIME Difference command??
the attached script can return the seconds since unix calender start (midnight 1970) and a specified time after that. It can be used in two ways: without parameters it uses the date command for finding the current system time and then counts the number of secs since unix cal start and that e.g.:
# ./return_seconds.sh
1066639969
Alternatively, you can specify 7 parameters for time, say for this date:
Mon Oct 20 14:22:52 2003
you need to specify this:
# ./return_seconds.sh 1970 2003 10 20 14 22 52
1066659772
The parameters are described in the script.
The difference:
# echo $(( 1066659772 - 1066639969))
19803
regards,
John K.