<?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 to get a date after a specific number of days? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754017#M657478</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt; could be with crontab?&lt;BR /&gt;&lt;BR /&gt; Regards, Jorge</description>
    <pubDate>Thu, 17 Feb 2011 08:49:23 GMT</pubDate>
    <dc:creator>Jorge Pons</dc:creator>
    <dc:date>2011-02-17T08:49:23Z</dc:date>
    <item>
      <title>How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754015#M657476</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;My date is in the format mmddyy. I need to know the date after say 25 days. Is there any specific command which can accompolish this?&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance!!</description>
      <pubDate>Thu, 17 Feb 2011 07:43:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754015#M657476</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-02-17T07:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754016#M657477</link>
      <description>&lt;P&gt;Please find the below thread in that there is a script from A. Clay Stephenson.kindly check whether it help you or not?&lt;BR /&gt;&lt;A href="http://h30499.www3.hp.com/t5/System-Administration/favourite-sysadmin-scripts-you-always-keep-around/m-p/4844855#M393717" target="_blank"&gt;http://h30499.www3.hp.com/t5/System-Administration/favourite-sysadmin-scripts-you-always-keep-around/m-p/4844855#M393717&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2011 19:46:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754016#M657477</guid>
      <dc:creator>nijokj</dc:creator>
      <dc:date>2011-09-02T19:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754017#M657478</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt; could be with crontab?&lt;BR /&gt;&lt;BR /&gt; Regards, Jorge</description>
      <pubDate>Thu, 17 Feb 2011 08:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754017#M657478</guid>
      <dc:creator>Jorge Pons</dc:creator>
      <dc:date>2011-02-17T08:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754018#M657479</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;Thank you all for your replies.&lt;BR /&gt;&lt;BR /&gt;Is there any other specific command to do that? &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Feb 2011 09:10:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754018#M657479</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-02-17T09:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754019#M657480</link>
      <description>If you have the GNU coreutils installed, you can use the GNU date command, which has a pile of date arithmetic capabilities. You can get GNU coreutils here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-8.6/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-8.6/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Don't miss the run-time dependencies required as well.&lt;BR /&gt;&lt;BR /&gt;With GNU date installed you can run:&lt;BR /&gt;&lt;BR /&gt;date --d "+25 days" +%m%d%y&lt;BR /&gt;&lt;BR /&gt;You'll need to put the path to the GNU date command in front of that, otherwise it will just invoke the HP-UX date command.&lt;BR /&gt;&lt;BR /&gt;No doubt the perl-mongers on the forums will also be able to give you a perl one-liner for this as well.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;DUncan</description>
      <pubDate>Thu, 17 Feb 2011 09:55:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754019#M657480</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2011-02-17T09:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754020#M657481</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This might help you. Try this.&lt;BR /&gt;&lt;BR /&gt;Result=$(perl -MPOSIX -le 'print strftime "%d%b",localtime(time+(60*60*24*25))')&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Feb 2011 10:37:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754020#M657481</guid>
      <dc:creator>satheeshnp</dc:creator>
      <dc:date>2011-02-17T10:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754021#M657482</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You might note that by using Perl and the 'strftime' function you can choose any date format you want.  The format directives are equivalent to those you are familiar with in the 'date' command.  Of course, see too the manpages for 'strftime(3C)'.  For example:&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le 'print strftime "%d %b",localtime(time+(60*60*24*25))'&lt;BR /&gt;14 Mar&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le 'print strftime "%m/%d/%Y",localtime(time+(60*60*24*25))'&lt;BR /&gt;03/14/2011&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le 'print strftime "%m/%d/%Y %H:%M",localtime(time+(60*60*24*25))'&lt;BR /&gt;03/14/2011 09:08&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Feb 2011 13:10:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754021#M657482</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-02-17T13:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754022#M657483</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;That perl scripting really worked. Thanks a lot:) &lt;BR /&gt;&lt;BR /&gt;But I am able to find the date after 25 days from today's date. Is there anyother modification I can do so that the perl will take my input?&lt;BR /&gt;&lt;BR /&gt;Actually I need to find the date after 25 days from a specific date but not from today's date.Kindly help.</description>
      <pubDate>Fri, 18 Feb 2011 05:50:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754022#M657483</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-02-18T05:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754023#M657484</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Actually I need to find the date after 25 days from a specific date but not from today's date.&lt;BR /&gt;&lt;BR /&gt;You can begin with something like this an embellish as you like.  Notice that I require the input as YYYYMMDD.&lt;BR /&gt;&lt;BR /&gt;# cat ./fromwhen&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use POSIX qw(strftime);&lt;BR /&gt;use Time::Local;&lt;BR /&gt;my $date = shift or die "Date (YYYYMMDD) expected\n";&lt;BR /&gt;die "YYYMMDD expected\n" unless&lt;BR /&gt;    my ( $yyyy, $mm, $dd ) = ( $date =~ /(\d{4})(\d\d)(\d\d)/ );&lt;BR /&gt;my $when = shift or die "Number of days in future expected\n";&lt;BR /&gt;my $secs = timelocal(0, 0, 0, $dd, $mm-1,$yyyy );&lt;BR /&gt;print strftime "%Y/%m/%d\n",localtime($secs+(60*60*24*$when));&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as (for example):&lt;BR /&gt;&lt;BR /&gt;# .l/fromwhen 20110218 13&lt;BR /&gt;2011/03/03&lt;BR /&gt;&lt;BR /&gt;...which yields the date thirteen (13) days from February 18, 2011.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 18 Feb 2011 14:36:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754023#M657484</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-02-18T14:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754024#M657485</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thankyou for the replies. &lt;BR /&gt;&lt;BR /&gt;I tried the script. I don't how exactly to run that script. I found no good results. I think I have done some mistake. Please help me with this.&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Mar 2011 12:57:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754024#M657485</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-03-18T12:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754025#M657486</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I tried the script. I don't how exactly to run that script. I found no good results. I think I have done some mistake.&lt;BR /&gt;&lt;BR /&gt;Copy&amp;amp;paste the script I posted into a file named as you wish.  Set execute permissions and then run it passing two arguments --- the first is the YYYYMMDD from which you want to count.  The second argument is the number of days from the first argument date that you want to compute.&lt;BR /&gt;&lt;BR /&gt;For example, I called the script 'fromwhen'.  Hence:&lt;BR /&gt;&lt;BR /&gt;# cd &amp;lt;script directory&amp;gt;&lt;BR /&gt;# chmod 555 ./fromwhen&lt;BR /&gt;# ./fromwhen 20110318 25&lt;BR /&gt;2011/04/12&lt;BR /&gt;&lt;BR /&gt;...which shows that April 12 is 25-days from March 18.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Mar 2011 13:18:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754025#M657486</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-18T13:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754026#M657487</link>
      <description>&amp;gt;&amp;gt; I tried the script. I don't how exactly to run that script. I found no good results. I think I have done some mistake. Please help me with this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hmmm. It works for me.&lt;BR /&gt;It came with usage example and has 'help' build in.&lt;BR /&gt;&lt;BR /&gt;copy &amp;amp; paste into a (text) file.&lt;BR /&gt;In the example: "fromwhen"&lt;BR /&gt;&lt;BR /&gt;Make executable&lt;BR /&gt;chmod +x fromwhen&lt;BR /&gt;&lt;BR /&gt;Run it with 2 arguments... a date and days&lt;BR /&gt;Example:&lt;BR /&gt;./fromwhen 20080101 32&lt;BR /&gt;2008/02/02&lt;BR /&gt;&lt;BR /&gt;Maybe your perl is not in the standard place?&lt;BR /&gt;Try 'which perl'&lt;BR /&gt;&lt;BR /&gt;Anyway...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I found no good results.&lt;BR /&gt;&lt;BR /&gt;So what did you get? Error message? Unexpected values? Show and tell!&lt;BR /&gt;We can not read your mind, nor your screen.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.</description>
      <pubDate>Fri, 18 Mar 2011 13:18:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754026#M657487</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2011-03-18T13:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754027#M657488</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;If your Perl isn't in '/usr/bin' simply change the 'shebang' line at the top of the script to point to the correct location.&lt;BR /&gt;&lt;BR /&gt;Most commonly, you declare '#!/usr/bin/perl' in your scripts and simply symlink the Perl binary accordingly. This allows your scripts to make a static declaration while your binaries are installed in various subdirectories of '/opt' or '/usr' as your needs dictate.&lt;BR /&gt;&lt;BR /&gt;Doing a 'whereis perl' is one way to find where 'perl' is.  Another option is to use this for the 'shebang' (interpreter line):&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/env perl&lt;BR /&gt;&lt;BR /&gt;If you do this, the Perl interpreter will be "automatically" located for you.&lt;BR /&gt;&lt;BR /&gt;As always, a problem description of "it doesn't work" doesn't provide any useful information.  Be specific.  Exactly what did you do and exactly what were the results you obtained.  A good problem description leads to a good resolution.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Mar 2011 13:26:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754027#M657488</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-18T13:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754028#M657489</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I tried running the script in the way you mentioned.&lt;BR /&gt;&lt;BR /&gt;Here is my error message:&lt;BR /&gt;&lt;BR /&gt;#./fromwhen 20110318 02&lt;BR /&gt;./fromwhen[3]: use:  not found.&lt;BR /&gt;./fromwhen[4]: use:  not found.&lt;BR /&gt;./fromwhen[5]: Syntax error at line 5 : `(' is not expected.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here is my whereis perl output :&lt;BR /&gt;&lt;BR /&gt;#whereis perl&lt;BR /&gt;perl: /usr/bin/perl /opt/dsau/bin/perl /opt/dsau/sbin/perl /opt/perl/bin/perl /opt/perl_32/bin/perl /opt/perl_64/bin/perl /opt/VRTSperl/bin/perl /usr/eccperl/bin/perl /opt/perl/man/man1/perl.1 /opt/perl_32/man/man1/perl.1 /opt/perl_64/man/man1/perl.1 /opt/VRTSperl/man/man1/perl.1&lt;BR /&gt;&lt;BR /&gt;Kindly help me with this.&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Mar 2011 14:19:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754028#M657489</guid>
      <dc:creator>Vidhya B</dc:creator>
      <dc:date>2011-03-18T14:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754029#M657490</link>
      <description>Do you have the first line of the script as:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;If not, make that the first line and then try again.</description>
      <pubDate>Fri, 18 Mar 2011 14:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754029#M657490</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2011-03-18T14:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754030#M657491</link>
      <description>Ah, looks like you have the line "# cat ./fromwhen" as the first line in the script.&lt;BR /&gt;Remove that.&lt;BR /&gt;That was there just for clarification, not for inclusion.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Mar 2011 14:26:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754030#M657491</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2011-03-18T14:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a date after a specific number of days?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754031#M657492</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;If you don't have an interpreter ("shebang") line in a file, then the shell is assumed.&lt;BR /&gt;&lt;BR /&gt;Hence, if you don't have:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;...as the first line of the script, then:&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;...is assumed, and that leads to errors as the shell interpreter attempts to parse Perl syntax!&lt;BR /&gt;&lt;BR /&gt;_Always_ begin your scripts with the interpreter declaration!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 18 Mar 2011 15:53:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-a-date-after-a-specific-number-of-days/m-p/4754031#M657492</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-18T15:53:01Z</dc:date>
    </item>
  </channel>
</rss>

