HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Manipulating TIME
Operating System - HP-UX
1834935
Members
2188
Online
110071
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
Forums
Discussions
Discussions
Discussions
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
07-18-2005 03:57 AM
07-18-2005 03:57 AM
Hello There!
Using HP-UX 11i
Well, I have a problem calculating time... Everytime my script runs I need it to increase one more minute in the "TIME" variable...
I'm collecting "TIME" this way:
TIME=`date +%H:%M:%S`
So, after that i need to increase 1 minute in this TIME variable...For Ex:
If TIME = 14:26:32
I need it to become 14:27:32
Any ideas about how can I do it!?
Thanks
Rafael M. Braga
Using HP-UX 11i
Well, I have a problem calculating time... Everytime my script runs I need it to increase one more minute in the "TIME" variable...
I'm collecting "TIME" this way:
TIME=`date +%H:%M:%S`
So, after that i need to increase 1 minute in this TIME variable...For Ex:
If TIME = 14:26:32
I need it to become 14:27:32
Any ideas about how can I do it!?
Thanks
Rafael M. Braga
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 04:27 AM
07-18-2005 04:27 AM
Re: Manipulating TIME
echo $TIME|awk -F " '{OFS=":";print $1,$2,$3}'
The catch is if minutes column is 60, you would increment hour feild and make second field to 0.
Anil
The catch is if minutes column is 60, you would increment hour feild and make second field to 0.
Anil
There is no substitute to HARDWORK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 04:48 AM
07-18-2005 04:48 AM
Solution
Instead, you can do this
HOUR=`date +%H`
MINUTE=`date +%M`
SECOND=`date +%S`
let NEW_MINUTE=${MINUTE}+1
if [ $NEW_MINUTE -eq 60 ]
then
NEW_MINUTE=00
let HOUR=${HOUR}+1
fi
if [ $HOUR -eq 24 ]
then
HOUR=00
fi
TIME=`printf ${HOUR}":"${NEW_MINUTE}":"${SECOND}`
hope this helps
HOUR=`date +%H`
MINUTE=`date +%M`
SECOND=`date +%S`
let NEW_MINUTE=${MINUTE}+1
if [ $NEW_MINUTE -eq 60 ]
then
NEW_MINUTE=00
let HOUR=${HOUR}+1
fi
if [ $HOUR -eq 24 ]
then
HOUR=00
fi
TIME=`printf ${HOUR}":"${NEW_MINUTE}":"${SECOND}`
hope this helps
________________________________
UNIX because I majored in cryptology...
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 05:04 AM
07-18-2005 05:04 AM
Re: Manipulating TIME
Thanks MEL...
10 for you!!
10 for you!!
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP