<?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 question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744478#M722006</link>
    <description>Thanks to both of you. I love sitting down at my desk and having an answer first thing in the morning!&lt;BR /&gt;&lt;BR /&gt;Clay, your corrected script worked the first time. I had no idea what all of it was doing so I ran each part of it starting from the right and working to the left to understand what was happening. I'm still confused but it works!&lt;BR /&gt;&lt;BR /&gt;It took me a while to realize that $(awk) was the same thing as `awk`. Did you really just type those commands in and hit SUBMIT or did you cut and paste from an existing script?&lt;BR /&gt;&lt;BR /&gt;Thanks very much,&lt;BR /&gt;Kris&lt;BR /&gt;</description>
    <pubDate>Fri, 14 Jun 2002 14:42:44 GMT</pubDate>
    <dc:creator>Kris Spander</dc:creator>
    <dc:date>2002-06-14T14:42:44Z</dc:date>
    <item>
      <title>Date question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744473#M722001</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have a problem that ought to be very simple. I can't find a utility that will let me calculate the date one week from some date. For example, if I have a date of 01-06-2001, how can I get 08-06-2001? This example is easy but it becomes more difficult at the end of a month or the end of a year. My dates need to be  dd-mm-yyyy.  I've already read the date man pages so please don't ask me to do that.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any help.&lt;BR /&gt;&lt;BR /&gt;Kris</description>
      <pubDate>Thu, 13 Jun 2002 22:12:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744473#M722001</guid>
      <dc:creator>Kris Spander</dc:creator>
      <dc:date>2002-06-13T22:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744474#M722002</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm not taking credit for this, but Sir A. Clay Stephenson's date hammer will get most people's vote in here. Here is one link which has it. My suggestion is to do a search from over here &amp;lt;-- on 'caljd.sh' on you'll find many examples as well!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x06ed660142b2d5118ff10090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x06ed660142b2d5118ff10090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;~Michael~</description>
      <pubDate>Thu, 13 Jun 2002 22:17:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744474#M722002</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2002-06-13T22:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744475#M722003</link>
      <description>Hi Kris:&lt;BR /&gt;&lt;BR /&gt;I ought to tell you to use that little search button but since you are a new Forums member, I'll make nice and I will admit that your request is a little tricky. It's time to introduce you to my date hammer (now where's your date nail), 'caljd.sh'. This guy takes calendar dates and turns them into Julian Days (~ number of days since 4713BCE) and also does the reverse.&lt;BR /&gt;&lt;BR /&gt;This should fix you:&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;while [ $# -ge 1 ]&lt;BR /&gt;  do&lt;BR /&gt;    DT=${1}&lt;BR /&gt;    DT7=$(caljd.sh -e -S "-"       $(caljd.sh -n 7 -e $(echo "${DT}" |       awk 'BEGIN {FS="-"} print $1,$2,$3}')))&lt;BR /&gt;    echo "${DT7}"&lt;BR /&gt;    shift&lt;BR /&gt;  done&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;----------------------------------------&lt;BR /&gt;&lt;BR /&gt;Note the "\" line continuation characters. If I haven't made a stupid typo that should work,&lt;BR /&gt;processing each argument supplied to this script. You will need to use the attached script 'caljd.sh' and make sure that it is in your PATH. If you are completely confused (and you should be at this point), after you install caljd.sh, execute caljd.sh -u and it will give full usage. Let me know if I messed up all this typing because there were enough ('s and $'s to confuse anybody. In case you are wondering where the one week came in, that's the -n 7, the -e says dd/mm/yyyy format and the -S "-" says use "-" to separate the fields.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jun 2002 22:28:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744475#M722003</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-13T22:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744476#M722004</link>
      <description>Hi again Kris:&lt;BR /&gt;&lt;BR /&gt;Forget my "Note the '\' line continuation character" comments. They were there when I posted but it looks like they were magically removed when I submitted. I should also tell you that there is a Perl version, caljd.pl that you should be able to retrieve with a search. The arguments are exactly the same, you simply substitute caljd.pl for caljd.sh. It's your choice.&lt;BR /&gt;&lt;BR /&gt;Clay&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jun 2002 22:33:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744476#M722004</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-13T22:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744477#M722005</link>
      <description>Hi (hopefully last time) Kris:&lt;BR /&gt;&lt;BR /&gt;I'm an idiot. I missed a '{' just before the 'print' statement in the awk part of this script. It should be:&lt;BR /&gt;awk 'BEGIN {FS="-"}{print $1,$2,$3}'&lt;BR /&gt;&lt;BR /&gt;The rest looks ok but I could have easily missed something else.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jun 2002 22:43:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744477#M722005</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-13T22:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744478#M722006</link>
      <description>Thanks to both of you. I love sitting down at my desk and having an answer first thing in the morning!&lt;BR /&gt;&lt;BR /&gt;Clay, your corrected script worked the first time. I had no idea what all of it was doing so I ran each part of it starting from the right and working to the left to understand what was happening. I'm still confused but it works!&lt;BR /&gt;&lt;BR /&gt;It took me a while to realize that $(awk) was the same thing as `awk`. Did you really just type those commands in and hit SUBMIT or did you cut and paste from an existing script?&lt;BR /&gt;&lt;BR /&gt;Thanks very much,&lt;BR /&gt;Kris&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Jun 2002 14:42:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744478#M722006</guid>
      <dc:creator>Kris Spander</dc:creator>
      <dc:date>2002-06-14T14:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744479#M722007</link>
      <description>Hi Kris:&lt;BR /&gt;&lt;BR /&gt;I just typed it in otherwise I probably wouldn't have missed that stupid '{'. I felt really dumb because I looked at that line for 30 seconds before I hit the button. And yes the $(command) syntax is now preferred over the older `command` syntax especially in cases where the $(commnds) are heavily nested.&lt;BR /&gt;&lt;BR /&gt;No more points please, Clay&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Jun 2002 15:28:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-question/m-p/2744479#M722007</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-14T15:28:14Z</dc:date>
    </item>
  </channel>
</rss>

