- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Please Help!!!
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
10-30-2002 11:34 AM
10-30-2002 11:34 AM
I 've been beating my head against a wall for days trying to find a neat way to count the number of days between dates like
01/15/2001 and 12/15/2002. Does anybody have a program or a script that will do this?
Thanks, Bob
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 11:30 AM
10-30-2002 11:30 AM
Re: Please Help!!!
You have two choices - you can search for "date hammer", or you can wait for Clay to notice this post and respond.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 11:33 AM
10-30-2002 11:33 AM
SolutionI. Take two Advil.
2. Download the attached script, caljd.sh, and put in in your PATH.
C. DT1=01/15/2001
DT2=12/15/2002
DAYS=$(($(caljd.sh -S "/" -c ${DT2}) - $(caljd.sh -S "/" -c ${DT1})))
echo "Days difference = ${DAYS".
Now wasn't that easy? Invoke as caljd.sh -u for full usage.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 11:34 AM
10-30-2002 11:34 AM
Re: Please Help!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 11:49 AM
10-30-2002 11:49 AM
Re: Please Help!!!
echo "Days difference = ${DAYS}".
You can also search for 'caljd.pl' if you want a Perl version of the script. The arguments are exactly the same. By the way, make sure that you use 4-digit years because caljd.sh (or .pl) will take you at your word and compute for 1st century AD dates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 11:53 AM
10-30-2002 11:53 AM
Re: Please Help!!!
;^)
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 12:48 PM
10-30-2002 12:48 PM
Re: Please Help!!!
I just did a search on "caljd" and found tons of cool ideas. It took me a little while to understand that $(cajld.sh) was the same as `calsh.sh` and I had no idea what $(( )) did but it worked perfectly the very first time.
I can't thank you guys enough.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 02:16 PM
10-30-2002 02:16 PM
Re: Please Help!!!
perl -MDate::Manip -le 'print Delta_Format(DateCalc("01/15/2001", "12/15/2002", \$err, 3), 0, "%dv")'