- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- change time man page
Operating System - HP-UX
1758595
Members
1976
Online
108872
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-03-2008 04:04 AM
тАО10-03-2008 04:04 AM
Re: change time man page
I see. You want to count seconds using base 10, where the time format uses base 60. Well you have to convert ot base 10 as you mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 10:37 AM
тАО10-03-2008 10:37 AM
Re: change time man page
While the man page says seconds, if you saw some time output like this:
real 45296.7
user 5678.9
sys 1744.0
would it be more useful? By common convention, the ":" character separates hours, minutes and seconds. Of course, there may be a different method used in a different country or language (see man environ, specifically LC_TIME). The time program always shows seconds until 59.9, then shows mins:secs until 59:59.9 and then shows hrs:mins:secs. Computers are quite happy with 45296.7 but humans are more comfortable with 12:34:56.7
Bill Hassell, sysadmin
real 45296.7
user 5678.9
sys 1744.0
would it be more useful? By common convention, the ":" character separates hours, minutes and seconds. Of course, there may be a different method used in a different country or language (see man environ, specifically LC_TIME). The time program always shows seconds until 59.9, then shows mins:secs until 59:59.9 and then shows hrs:mins:secs. Computers are quite happy with 45296.7 but humans are more comfortable with 12:34:56.7
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 12:11 PM
тАО10-03-2008 12:11 PM
Re: change time man page
Hi Brem:
To add to Bill's discussion, here's a little Perl snippet to convert a time format of H:M:S.f to seconds:
# TIME=12:34:56.7
# echo ${TIME} | perl -nle '@t=reverse split /:/;for (1,60,3600) {$sec+=$t[$i]*$_;$i++};END{print $sec}'
45296.7
This works equally well for only minutes and seconds, too, like:
# TIME=3:11.8
# echo ${TIME} | perl ...
191.8
Regards!
...JRF...
Regards!
...JRF...
To add to Bill's discussion, here's a little Perl snippet to convert a time format of H:M:S.f to seconds:
# TIME=12:34:56.7
# echo ${TIME} | perl -nle '@t=reverse split /:/;for (1,60,3600) {$sec+=$t[$i]*$_;$i++};END{print $sec}'
45296.7
This works equally well for only minutes and seconds, too, like:
# TIME=3:11.8
# echo ${TIME} | perl ...
191.8
Regards!
...JRF...
Regards!
...JRF...
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP