<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I subtract 1 day from date in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571495#M30620</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;Here is a nice script written by Tom Danzig that will work back to 01/01/01.&lt;BR /&gt;&lt;BR /&gt;usage is :- datwhen -n &lt;NUMBER of="" days=""&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula&lt;/NUMBER&gt;</description>
    <pubDate>Sat, 01 Sep 2001 06:37:03 GMT</pubDate>
    <dc:creator>Paula J Frazer-Campbell</dc:creator>
    <dc:date>2001-09-01T06:37:03Z</dc:date>
    <item>
      <title>How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571486#M30611</link>
      <description>I have a script with:&lt;BR /&gt;&lt;BR /&gt;Day = 'date +%a'&lt;BR /&gt;&lt;BR /&gt;dumpfile="holdfile_${Day}.dmp.Z &lt;BR /&gt;&lt;BR /&gt;I need to subract 1 day from the date.&lt;BR /&gt;Can you &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Aug 2001 17:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571486#M30611</guid>
      <dc:creator>Helen Herring</dc:creator>
      <dc:date>2001-08-28T17:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571487#M30612</link>
      <description>Hi Kathy,&lt;BR /&gt;&lt;BR /&gt;You could do something as simple as&lt;BR /&gt;&lt;BR /&gt;YESTERDAY=`TZ=PST+24 date +%D`&lt;BR /&gt;or in perl&lt;BR /&gt;yesterday=$(perl -e 'print scalar localtime(time-1*86400),"\n"' | cut -c 5-11)&lt;BR /&gt;&lt;BR /&gt;If you want more, just do a search in the forums, you will get quite a few options&lt;BR /&gt;&lt;BR /&gt;-Regards&lt;BR /&gt;Ramesh</description>
      <pubDate>Tue, 28 Aug 2001 17:32:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571487#M30612</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-08-28T17:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571488#M30613</link>
      <description>Hi Kathy,&lt;BR /&gt;&lt;BR /&gt;My mistake, you are using &lt;BR /&gt;Day = `date +%a`&lt;BR /&gt;&lt;BR /&gt;which gives the day of the week, so you may have to use&lt;BR /&gt;yest=`TZ=PST+24 date +%a`&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
      <pubDate>Tue, 28 Aug 2001 17:38:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571488#M30613</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-08-28T17:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571489#M30614</link>
      <description>For something like keeping track of dumps and this like that, I have found it easier to user julian date. &lt;BR /&gt;&lt;BR /&gt;DAY=`date +%j`&lt;BR /&gt;YESTERDAY=`expr $DAY - 1`&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Tue, 28 Aug 2001 17:39:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571489#M30614</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-28T17:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571490#M30615</link>
      <description>I want to use the day of the week.  Can the -1 be used with day if day has been set to the day of the week?</description>
      <pubDate>Tue, 28 Aug 2001 17:56:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571490#M30615</guid>
      <dc:creator>Helen Herring</dc:creator>
      <dc:date>2001-08-28T17:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571491#M30616</link>
      <description>Sure, the only problem will be Monday which is 1.  However, you can fix that:&lt;BR /&gt;&lt;BR /&gt;DAY=`date +%u` #DAYS of week mon-sun 1-7&lt;BR /&gt;if [ $DAY -eq 1 ]&lt;BR /&gt;then&lt;BR /&gt;    YESTERDAY=7&lt;BR /&gt;else &lt;BR /&gt;    YESTERDAY=`expr $DAY - 1`&lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Tue, 28 Aug 2001 18:29:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571491#M30616</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-28T18:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571492#M30617</link>
      <description>If you have perl running on your system try using this command:&lt;BR /&gt;&lt;BR /&gt;perl -e 'print scalar localtime(time-1*86400),"\n"'&lt;BR /&gt;&lt;BR /&gt;And yes this works with text dates</description>
      <pubDate>Fri, 31 Aug 2001 21:43:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571492#M30617</guid>
      <dc:creator>Jeffrey S. Sims</dc:creator>
      <dc:date>2001-08-31T21:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571493#M30618</link>
      <description>Kathy,&lt;BR /&gt;&lt;BR /&gt;I will prepare a table like this&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;MON=1&lt;BR /&gt;TUES=2&lt;BR /&gt;WED=3&lt;BR /&gt;THU=4&lt;BR /&gt;FRI=5&lt;BR /&gt;SAT=6&lt;BR /&gt;SUN=7&lt;BR /&gt;&lt;BR /&gt;NOW you can use the same trick as told by Joseph.&lt;BR /&gt;&lt;BR /&gt;DAY=`date +%u`&lt;BR /&gt;if [ $DAY -eq 1 ]&lt;BR /&gt;then&lt;BR /&gt;YESTERDAY=7&lt;BR /&gt;else&lt;BR /&gt;YESTERDAY=`expr $DAY - 1`&lt;BR /&gt;YESTERDAY_IS=`grep YESTERDAY table |awk '{FS=&lt;BR /&gt;"=";print $1}`&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;You can use YESTERDAY_IS in your program to replace the day of the week.&lt;BR /&gt;&lt;BR /&gt;-Sri &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Aug 2001 22:22:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571493#M30618</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-31T22:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571494#M30619</link>
      <description>Kathy,&lt;BR /&gt;&lt;BR /&gt;I will prepare a table like this&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;MON=1&lt;BR /&gt;TUES=2&lt;BR /&gt;WED=3&lt;BR /&gt;THU=4&lt;BR /&gt;FRI=5&lt;BR /&gt;SAT=6&lt;BR /&gt;SUN=7&lt;BR /&gt;&lt;BR /&gt;NOW you can use the same trick as told by Joseph.&lt;BR /&gt;&lt;BR /&gt;DAY=`date +%u`&lt;BR /&gt;if [ $DAY -eq 1 ]&lt;BR /&gt;then&lt;BR /&gt;YESTERDAY=7&lt;BR /&gt;else&lt;BR /&gt;YESTERDAY=`expr $DAY - 1`&lt;BR /&gt;YESTERDAY_IS=`grep $YESTERDAY table |awk '{FS=&lt;BR /&gt;"=";print $1}`&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;You can use YESTERDAY_IS in your program to replace the day of the week.&lt;BR /&gt;&lt;BR /&gt;-Sri &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Aug 2001 22:22:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571494#M30619</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-31T22:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571495#M30620</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Here is a nice script written by Tom Danzig that will work back to 01/01/01.&lt;BR /&gt;&lt;BR /&gt;usage is :- datwhen -n &lt;NUMBER of="" days=""&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula&lt;/NUMBER&gt;</description>
      <pubDate>Sat, 01 Sep 2001 06:37:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571495#M30620</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2001-09-01T06:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I subtract 1 day from date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571496#M30621</link>
      <description>ps&lt;BR /&gt;&lt;BR /&gt;to clarify the datewhen bit :- that is what I called the script on my server.&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Sat, 01 Sep 2001 06:38:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-subtract-1-day-from-date/m-p/2571496#M30621</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2001-09-01T06:38:50Z</dc:date>
    </item>
  </channel>
</rss>

