<?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: get date of last week with script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239258#M676282</link>
    <description>This will be very easy if  you convert today date to epoch  time,&lt;BR /&gt;then minus 7 days, then convert the result back to normal date/time&lt;BR /&gt;&lt;BR /&gt;Gudluck&lt;BR /&gt;Prasanth</description>
    <pubDate>Tue, 11 May 2010 04:59:44 GMT</pubDate>
    <dc:creator>Prasanth V Aravind</dc:creator>
    <dc:date>2010-05-11T04:59:44Z</dc:date>
    <item>
      <title>get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239257#M676281</link>
      <description>Dear all&lt;BR /&gt;i'm mading a script&lt;BR /&gt;i want to get all date of last week with script.&lt;BR /&gt;today is 05/04/2010&lt;BR /&gt;Begin date will be Mon - 04/26/2010&lt;BR /&gt;Tue - 04/27/2010&lt;BR /&gt;Wed - 04/28/2010&lt;BR /&gt;Thu - 04/29/2010&lt;BR /&gt;Fri - 04/30/2010&lt;BR /&gt;Sat - 05/01/2010&lt;BR /&gt;End date will be Sun - 05/02/2010&lt;BR /&gt;&lt;BR /&gt;how can i make a script.&lt;BR /&gt;help me &lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 11 May 2010 04:37:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239257#M676281</guid>
      <dc:creator>Kyuyong-Kwon</dc:creator>
      <dc:date>2010-05-11T04:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239258#M676282</link>
      <description>This will be very easy if  you convert today date to epoch  time,&lt;BR /&gt;then minus 7 days, then convert the result back to normal date/time&lt;BR /&gt;&lt;BR /&gt;Gudluck&lt;BR /&gt;Prasanth</description>
      <pubDate>Tue, 11 May 2010 04:59:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239258#M676282</guid>
      <dc:creator>Prasanth V Aravind</dc:creator>
      <dc:date>2010-05-11T04:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239259#M676283</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you wanted the last seven days, you could do:&lt;BR /&gt;&lt;BR /&gt;# perl -le '$t=time();for ($d=$t-(7*86400);$d&amp;lt;=$t;$d+=86400) {print scalar localtime($d)}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 11 May 2010 05:10:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239259#M676283</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-11T05:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239260#M676284</link>
      <description>James &lt;BR /&gt;Thank you very much.......</description>
      <pubDate>Tue, 11 May 2010 05:36:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239260#M676284</guid>
      <dc:creator>Kyuyong-Kwon</dc:creator>
      <dc:date>2010-05-11T05:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239261#M676285</link>
      <description>Oh I'm sorry. &lt;BR /&gt;I don't wanted the last seven days from today&lt;BR /&gt;i wanted all date of last week.&lt;BR /&gt;Get date =&amp;gt; monday~Sunday of last week.&lt;BR /&gt;Please help me.&lt;BR /&gt;&lt;BR /&gt;Good luck.</description>
      <pubDate>Tue, 11 May 2010 06:02:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239261#M676285</guid>
      <dc:creator>Kyuyong-Kwon</dc:creator>
      <dc:date>2010-05-11T06:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239262#M676286</link>
      <description>#!/usr/bin/ksh &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Current_time_epoch=`perl -e  "print time "`&lt;BR /&gt;Week_day=`date +%a`&lt;BR /&gt;&lt;BR /&gt;#days to be minus to get last sunday&lt;BR /&gt;# IF today is &lt;BR /&gt;# Sunday = 7days &lt;BR /&gt;#  monday = 8days&lt;BR /&gt;#  teusday= 9days&lt;BR /&gt;# Wednesday= 10days&lt;BR /&gt;# Thursday= 11days&lt;BR /&gt;# friday=  12days&lt;BR /&gt;# saturday= 13days&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;case "$Week_day" in &lt;BR /&gt;Sun ) Sec_to_last_sunday=` echo 7 | awk '{print $1*24*60*60}'` ;;&lt;BR /&gt;Mon ) Sec_to_last_sunday=` echo 8 | awk '{print $1*24*60*60}'` ;;&lt;BR /&gt;Tue ) Sec_to_last_sunday=` echo 9 | awk '{print $1*24*60*60}'` ;;&lt;BR /&gt;Wed ) Sec_to_last_sunday=` echo 10 | awk '{print $1*24*60*60}'` ;;&lt;BR /&gt;Thu ) Sec_to_last_sunday=` echo 11 | awk '{print $1*24*60*60}'` ;;&lt;BR /&gt;Fri ) Sec_to_last_sunday=` echo 12 | awk '{print $1*24*60*60}'` ;;&lt;BR /&gt;Sat ) Sec_to_last_sunday=` echo 13 | awk '{print $1*24*60*60}'` ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;let  "Last_Sunday_epoch = $Current_time_epoch - $Sec_to_last_sunday"&lt;BR /&gt;let  "Last_Mon_epoch = $Last_Sunday_epoch + 86400"&lt;BR /&gt;let  "Last_Tue_epoch = $Last_Mon_epoch + 86400"&lt;BR /&gt;let  "Last_Wed_epoch = $Last_Tue_epoch + 86400"&lt;BR /&gt;let  "Last_Thu_epoch = $Last_Wed_epoch + 86400"&lt;BR /&gt;let  "Last_Fri_epoch = $Last_Thu_epoch + 86400"&lt;BR /&gt;let  "Last_Sat_epoch = $Last_Fri_epoch + 86400"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;############Create a tmplate script ######&lt;BR /&gt;&lt;BR /&gt;echo '#!/usr/bin/perl&lt;BR /&gt;$time = localtime($ARGV[0]);&lt;BR /&gt;print "$time\n";&lt;BR /&gt;&lt;BR /&gt;' &amp;gt; /tmp/epoch_to_normal.pl &lt;BR /&gt;&lt;BR /&gt;chmod 755 /tmp/epoch_to_normal.pl&lt;BR /&gt;#############################################&lt;BR /&gt;&lt;BR /&gt;/tmp/epoch_to_normal.pl $Last_Sunday_epoch&lt;BR /&gt;/tmp/epoch_to_normal.pl $Last_Mon_epoch&lt;BR /&gt;/tmp/epoch_to_normal.pl $Last_Tue_epoch&lt;BR /&gt;/tmp/epoch_to_normal.pl $Last_Wed_epoch&lt;BR /&gt;/tmp/epoch_to_normal.pl $Last_Thu_epoch&lt;BR /&gt;/tmp/epoch_to_normal.pl $Last_Fri_epoch&lt;BR /&gt;/tmp/epoch_to_normal.pl $Last_Sat_epoch&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Try</description>
      <pubDate>Tue, 11 May 2010 06:10:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239262#M676286</guid>
      <dc:creator>Prasanth V Aravind</dc:creator>
      <dc:date>2010-05-11T06:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239263#M676287</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;your expected output is like this ????&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[root@vm1 ~]# ./get_last_week_days.sh &lt;BR /&gt;Sun May  2 08:34:10 2010&lt;BR /&gt;Mon May  3 08:34:10 2010&lt;BR /&gt;Tue May  4 08:34:10 2010&lt;BR /&gt;Wed May  5 08:34:10 2010&lt;BR /&gt;Thu May  6 08:34:10 2010&lt;BR /&gt;Fri May  7 08:34:10 2010&lt;BR /&gt;Sat May  8 08:34:10 2010&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Gudluck&lt;BR /&gt;Prasanth</description>
      <pubDate>Tue, 11 May 2010 06:11:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239263#M676287</guid>
      <dc:creator>Prasanth V Aravind</dc:creator>
      <dc:date>2010-05-11T06:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239264#M676288</link>
      <description>Wow Thank you for reply!!!   :-)</description>
      <pubDate>Tue, 11 May 2010 06:39:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239264#M676288</guid>
      <dc:creator>Kyuyong-Kwon</dc:creator>
      <dc:date>2010-05-11T06:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239265#M676289</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;...or all in Perl:&lt;BR /&gt;&lt;BR /&gt;# perl -le '$t=time();$d=7+(localtime)[6];$b=$t-($d*86400);for (0..6) {print scalar localtime($b+($_*86400))}'&lt;BR /&gt;Sun May  2 09:34:33 2010&lt;BR /&gt;Mon May  3 09:34:33 2010&lt;BR /&gt;Tue May  4 09:34:33 2010&lt;BR /&gt;Wed May  5 09:34:33 2010&lt;BR /&gt;Thu May  6 09:34:33 2010&lt;BR /&gt;Fri May  7 09:34:33 2010&lt;BR /&gt;Sat May  8 09:34:33 2010&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 11 May 2010 12:37:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239265#M676289</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-11T12:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239266#M676290</link>
      <description>Dear James&lt;BR /&gt;i have a question.&lt;BR /&gt;i don't know perl script.&lt;BR /&gt;i want to change date format as below:&lt;BR /&gt;Mon May  3 10:42:43 2010 =&amp;gt; 20100503&lt;BR /&gt;&lt;BR /&gt;Please help me.&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 12 May 2010 00:46:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239266#M676290</guid>
      <dc:creator>Kyu-Yong Kwon</dc:creator>
      <dc:date>2010-05-12T00:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239267#M676291</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; i want to change date format as below:&lt;BR /&gt;Mon May 3 10:42:43 2010 =&amp;gt; 20100503&lt;BR /&gt;&lt;BR /&gt;Use this:&lt;BR /&gt;&lt;BR /&gt;# cat ./lastweek&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my $t = time();&lt;BR /&gt;my @t = localtime($t);&lt;BR /&gt;my $d = 7 + (@t)[6];&lt;BR /&gt;my $b = $t - ( $d * 86400 );&lt;BR /&gt;for ( 0 .. 6 ) {&lt;BR /&gt;    $t = ( $b + ( $_ * 86400 ) );&lt;BR /&gt;    @t = localtime( $b + ( $_ * 86400 ) );&lt;BR /&gt;    printf "%s =&amp;gt; %4d%02d%02d\n", scalar localtime($t), $t[5] + 1900,&lt;BR /&gt;        $t[4] + 1, $t[3];&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./lastweek&lt;BR /&gt;Sun May  2 11:01:06 2010 =&amp;gt; 20100502&lt;BR /&gt;Mon May  3 11:01:06 2010 =&amp;gt; 20100503&lt;BR /&gt;Tue May  4 11:01:06 2010 =&amp;gt; 20100504&lt;BR /&gt;Wed May  5 11:01:06 2010 =&amp;gt; 20100505&lt;BR /&gt;Thu May  6 11:01:06 2010 =&amp;gt; 20100506&lt;BR /&gt;Fri May  7 11:01:06 2010 =&amp;gt; 20100507&lt;BR /&gt;Sat May  8 11:01:06 2010 =&amp;gt; 20100508&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Please reopen this thread to assign points appropriately.  See:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://forums11.itrc.hp.com/service/forums/helptips.do?#41" target="_blank"&gt;https://forums11.itrc.hp.com/service/forums/helptips.do?#41&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://forums11.itrc.hp.com/service/forums/helptips.do?#22" target="_blank"&gt;https://forums11.itrc.hp.com/service/forums/helptips.do?#22&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 12 May 2010 14:04:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239267#M676291</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-12T14:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239268#M676292</link>
      <description>thanks a lot</description>
      <pubDate>Wed, 12 May 2010 23:01:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239268#M676292</guid>
      <dc:creator>Kyu-Yong Kwon</dc:creator>
      <dc:date>2010-05-12T23:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: get date of last week with script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239269#M676293</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; thanks a lot&lt;BR /&gt;&lt;BR /&gt;I'm glad you're satisfied with the answers provided.  The appropriate thing to do is to reopen this thread and assign points appropriately.  See:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://forums11.itrc.hp.com/service/forums/helptips.do?#41" target="_blank"&gt;https://forums11.itrc.hp.com/service/forums/helptips.do?#41&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://forums11.itrc.hp.com/service/forums/helptips.do?#22" target="_blank"&gt;https://forums11.itrc.hp.com/service/forums/helptips.do?#22&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 13 May 2010 07:34:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-date-of-last-week-with-script/m-p/5239269#M676293</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-13T07:34:46Z</dc:date>
    </item>
  </channel>
</rss>

