- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to display today - 1?
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
07-14-2005 04:33 PM
07-14-2005 04:33 PM
how to display today - 1?
For example, today is 07/15/05, but how to get 07/14/05?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2005 04:43 PM
07-14-2005 04:43 PM
Re: how to display today - 1?
Download a copy of caljd.sh to /usr/local/bin
http://mirrors.develooper.com/hpux/caljd-2.23.sh
create a small script
#!/usr/bin/ksh
CALJD=/usr/local/bin/caljd.sh
# set date 1 day back
YESTERDAY=$($CALJD -Y -s $($CALJD -p +1))
echo $YESTERDAY
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2005 06:13 PM
07-14-2005 06:13 PM
Re: how to display today - 1?
#TZ=GMT24 date '+%Y%m%d'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2005 06:19 PM
07-14-2005 06:19 PM
Re: how to display today - 1?
http://forums2.itrc.hp.com/service/forums/questionanswer.do?threadId=937198
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2005 06:29 PM
07-14-2005 06:29 PM
Re: how to display today - 1?
OLDTZ=$TZ
echo "Today's Date : `date +'%x'`;
TZ=$TZ+24
echo "Yesterday's Date : `date +'%x'`"
TZ=$OLDTZ
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2005 08:26 PM
07-14-2005 08:26 PM
Re: how to display today - 1?
with ACS caljd.sh script (attached), you can try the following:
DT=$(caljd.sh $(caljd.sh -p 1))
echo "Date 1 days before was ${DT}"
hope this helps!
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2005 10:34 PM
07-14-2005 10:34 PM
Re: how to display today - 1?
TZ=aaa24 date +%Y%m%d
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2005 12:01 AM
07-15-2005 12:01 AM
Re: how to display today - 1?
Adjust the numeric figure for the respective time zone you are in...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2005 12:06 AM
07-15-2005 12:06 AM
Re: how to display today - 1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2005 12:13 AM
07-15-2005 12:13 AM
Re: how to display today - 1?
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2005 12:21 AM
07-15-2005 12:21 AM
Re: how to display today - 1?
http://mirrors.develooper.com/hpux/faq.html
--8<---
How do I print Yesterday?
d3:/ 102 > echo 'Yesterday'
Yesterday
d3:/ 103 > perl -le 'print scalar localtime time - 86400'
Or use A.Clay Stephenson's date hammer, which can also be used for more complicated actions from the command line, as will using the modules Date::Calc or Date::Manip with Perl.
-->8---
Clay's date hammer also available there in both shell and perl version
Enjoy, Have FUN! H.Merijn