<?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: Date manipulation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403817#M682964</link>
    <description>Thanks James for your input. But my concern is different.&lt;BR /&gt;&lt;BR /&gt;Suppose I want to show the yesterday or day before yesterday date, and my current date is the first of month. How can I manipulate that the previous date was the last of past month?</description>
    <pubDate>Tue, 21 Apr 2009 05:50:39 GMT</pubDate>
    <dc:creator>Jeeshan</dc:creator>
    <dc:date>2009-04-21T05:50:39Z</dc:date>
    <item>
      <title>Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403812#M682959</link>
      <description>I have some scripts which are using for different purposes, like disk monitoring, log monitoring etc. etc.But I have a problem regarding date manipulation.&lt;BR /&gt;&lt;BR /&gt;Say on 1st April, I have to check the logs of yesterday which is 31st March. Then how would my system will act according to the month whatever comes.&lt;BR /&gt;&lt;BR /&gt;what would be the solution?</description>
      <pubDate>Mon, 20 Apr 2009 07:34:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403812#M682959</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2009-04-20T07:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403813#M682960</link>
      <description>Clay's date hammer, available here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cmve.net/merijn/caljd-2.25.sh" target="_blank"&gt;http://www.cmve.net/merijn/caljd-2.25.sh&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;resolves most of these date manipulation challenges...&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Mon, 20 Apr 2009 07:39:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403813#M682960</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2009-04-20T07:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403814#M682961</link>
      <description>Thanks Duncan, How can I use this in my script?</description>
      <pubDate>Mon, 20 Apr 2009 07:46:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403814#M682961</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2009-04-20T07:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403815#M682962</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Read the script.&lt;BR /&gt;&lt;BR /&gt;There is commentary inside that says exactly how to use it.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 20 Apr 2009 07:50:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403815#M682962</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-04-20T07:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403816#M682963</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If it's simply yesterday that you want to derive (in whatever format you desire), use a simple Perl script:&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le 'print strftime("%b %02d",localtime(time-24*60*60))'&lt;BR /&gt;&lt;BR /&gt;Apr 19&lt;BR /&gt;&lt;BR /&gt;You can use any of the 'date' formatting directives in place of what I have shown.&lt;BR /&gt;&lt;BR /&gt;For example if you wanted a MM/DD/YYYY format:&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le 'print strftime("%m/%02d/%Y",localtime(time-24*60*60))'&lt;BR /&gt;&lt;BR /&gt;04/19/2009&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 20 Apr 2009 11:18:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403816#M682963</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-20T11:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403817#M682964</link>
      <description>Thanks James for your input. But my concern is different.&lt;BR /&gt;&lt;BR /&gt;Suppose I want to show the yesterday or day before yesterday date, and my current date is the first of month. How can I manipulate that the previous date was the last of past month?</description>
      <pubDate>Tue, 21 Apr 2009 05:50:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403817#M682964</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2009-04-21T05:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403818#M682965</link>
      <description>hi,&lt;BR /&gt;do you need the last day of teh previous month or yesterday?&lt;BR /&gt;Please, specify.&lt;BR /&gt;Rgds,&lt;BR /&gt;Art</description>
      <pubDate>Tue, 21 Apr 2009 06:47:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403818#M682965</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2009-04-21T06:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403819#M682966</link>
      <description>HI (again) Ahsan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Suppose I want to show the yesterday or day before yesterday date, and my current date is the first of month.&lt;BR /&gt;&lt;BR /&gt;The Perl snippet I offered handles month and/or year changes too.  With a minor modification, we can make the code report any number of days in the past or the future.  Once again, you can use any of the 'date(1)' or 'strftime(3C)' formatting directives you see in their manpages.&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le '$d=shift||1;print strftime("%b %02d",localtime(time-$d*24*60*60))' &lt;BR /&gt;&lt;BR /&gt;...yields yesterday as we have seen.  NOtice that I didn't pass any argument.  I could have passed "1" for one-day.  Passing an argument of "0" would simply return today.&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le '$d=shift||1;print strftime("%b %02d",localtime(time-$d*24*60*60))' 2&lt;BR /&gt;&lt;BR /&gt;...gives you the date two days ago.&lt;BR /&gt;&lt;BR /&gt;perl -MPOSIX -le '$d=shift||1;print strftime("%b %02d",localtime(time-$d*24*60*60))' -- -1&lt;BR /&gt;&lt;BR /&gt;...gives you tomorrow.  NOtice that the '--' says that what follows isn't a switch, but an argument.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 21 Apr 2009 08:15:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403819#M682966</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-21T08:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Date manipulation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403820#M682967</link>
      <description>Thanks for your valuable suggestions.&lt;BR /&gt;&lt;BR /&gt;I have a perl script which read date from a file and convert it like "yyyymmdd". But problem is if its read the date like "Fri Jul 13 04:44:01 2009" then its output is "20090713" whether when it reads the date like&lt;BR /&gt;"Sat Jul  4 12:54:22 2009" then it doesn't gives any output. The code is like&lt;BR /&gt;&lt;BR /&gt;$ cat filter.pl&lt;BR /&gt;#!/usr/bin/perl -nl&lt;BR /&gt;BEGIN{&lt;BR /&gt;%m=(Jan=&amp;gt;1,Feb=&amp;gt;2,Mar=&amp;gt;3,Apr=&amp;gt;4,May=&amp;gt;5,Jun=&amp;gt;6,&lt;BR /&gt;    Jul=&amp;gt;7,Aug=&amp;gt;8,Sep=&amp;gt;9,Oct=&amp;gt;10,Nov=&amp;gt;11,Dec=&amp;gt;12)};&lt;BR /&gt;    m{^Event.+(\w{3})\s(\d\d|\d).+\s(\d{4})} and&lt;BR /&gt;        printf "%4d%02d%02d\n",$3,$m{$1},$2;&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;how can i solve this?</description>
      <pubDate>Sat, 04 Jul 2009 04:54:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-manipulation/m-p/4403820#M682967</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2009-07-04T04:54:09Z</dc:date>
    </item>
  </channel>
</rss>

