<?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: Reg Previous date calculation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207511#M167908</link>
    <description>I miss tools and utilities to handle dates and times.</description>
    <pubDate>Thu, 04 Mar 2004 09:40:20 GMT</pubDate>
    <dc:creator>Jdamian</dc:creator>
    <dc:date>2004-03-04T09:40:20Z</dc:date>
    <item>
      <title>Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207504#M167901</link>
      <description>hi friends,&lt;BR /&gt;  i am using the following command for calculating the previous date in hp unix server.&lt;BR /&gt;&lt;BR /&gt;$(sh -c "TZ=$(date +%Z)+24; export TZ; date '+%Y%m%d'")&lt;BR /&gt;&lt;BR /&gt;But it is not working now.i dont know why. so if any body plz let me know any command to calculate the prevoius date.it is very urgent to me.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;HariKrishna</description>
      <pubDate>Tue, 02 Mar 2004 22:48:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207504#M167901</guid>
      <dc:creator>harikrishna</dc:creator>
      <dc:date>2004-03-02T22:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207505#M167902</link>
      <description>Hi HariKrishna,&lt;BR /&gt;&lt;BR /&gt;Try the following simple script&lt;BR /&gt;&lt;BR /&gt;NOW=$(/usr/contrib/bin/perl -e "printf("%d\n",time())")&lt;BR /&gt;(( YES = $NOW - 86400 ))&lt;BR /&gt;echo "0d${YES}=Y" |adb&lt;BR /&gt;&lt;BR /&gt;86400 is the number of seconds since yesterday. If you want 'n' days back, then you calculate it by doing n*24*60*60&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Mar 2004 22:55:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207505#M167902</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-03-02T22:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207506#M167903</link>
      <description>hi sri,&lt;BR /&gt;  thanks for giving the reply.but i want the code in unix script only .&lt;BR /&gt;&lt;BR /&gt;plz let me know if you know it in the unix&lt;BR /&gt;&lt;BR /&gt;Thanking you&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;HariKrishna</description>
      <pubDate>Tue, 02 Mar 2004 22:59:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207506#M167903</guid>
      <dc:creator>harikrishna</dc:creator>
      <dc:date>2004-03-02T22:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207507#M167904</link>
      <description>Hi Harikrishna,&lt;BR /&gt;&lt;BR /&gt;That is unix script. Perl is available in /usr/contrib/bin on any HP-UX and it is used only once to get the epoch seconds. Rest are all HP commands.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Tue, 02 Mar 2004 23:03:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207507#M167904</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-03-02T23:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207508#M167905</link>
      <description>Tricks that alter TZ only work over a limited range of TZ's because the offset must remain in the range 0-23. Scripts that violate this only work by accident and can break without warning (e.g. a patch to the date command of libC). Man 5 environ for details. The Perl solution is a valid one but here's a method that will work over any date range --- including those that will kill the Perl solution.&lt;BR /&gt;&lt;BR /&gt;YESTERDAY=$(caljd.sh -s -y $(calhd.sh -p 1))&lt;BR /&gt;echo "Yesterday = ${YESTERDAY}"&lt;BR /&gt;&lt;BR /&gt;If you like, you can yank out the cal_jdate and jdate_cal functions and use them inside your own script for a "pure" shell solution.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Mar 2004 12:23:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207508#M167905</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-03T12:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207509#M167906</link>
      <description>The following is used quite a bit here and differs only in the variable value read in.&lt;BR /&gt;TZ=PST8PDT+24 date +%A | read Yesterday&lt;BR /&gt;&lt;BR /&gt;But for a robust and solid date routine, A.Clay's has been noted by many to be the top choice.&lt;BR /&gt;&lt;BR /&gt;We also use his. Shucks, now I owe royalties.&lt;BR /&gt;&lt;BR /&gt;Best of luck.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Wed, 03 Mar 2004 19:22:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207509#M167906</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2004-03-03T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207510#M167907</link>
      <description>Ooops, you'd think I could get my own command right, should be:&lt;BR /&gt;&lt;BR /&gt;YESTERDAY=$(caljd.sh -s -y $(caljd.sh -p 1))&lt;BR /&gt;echo "Yesterday = ${YESTERDAY}"&lt;BR /&gt;&lt;BR /&gt;Invoke as caljd.sh -u for full usage and examples.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Mar 2004 19:30:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207510#M167907</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-03T19:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Previous date calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207511#M167908</link>
      <description>I miss tools and utilities to handle dates and times.</description>
      <pubDate>Thu, 04 Mar 2004 09:40:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/reg-previous-date-calculation/m-p/3207511#M167908</guid>
      <dc:creator>Jdamian</dc:creator>
      <dc:date>2004-03-04T09:40:20Z</dc:date>
    </item>
  </channel>
</rss>

