<?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: Convert Any Date Into A 3-digit Decimal Number in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241644#M173755</link>
    <description>Hi Suren,&lt;BR /&gt;&lt;BR /&gt;Well if all you're looking for is the day of the year in a 3-digit output, the date command alone can do that - as follows:&lt;BR /&gt;&lt;BR /&gt;date +%j&lt;BR /&gt;&lt;BR /&gt;will give you that.&lt;BR /&gt;man date for details.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
    <pubDate>Tue, 06 Apr 2004 16:34:44 GMT</pubDate>
    <dc:creator>Jeff Schussele</dc:creator>
    <dc:date>2004-04-06T16:34:44Z</dc:date>
    <item>
      <title>Convert Any Date Into A 3-digit Decimal Number</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241641#M173752</link>
      <description>Hello All,&lt;BR /&gt;&lt;BR /&gt;I need to convert any date into a 3 digit decimal number for scripting purposes.&lt;BR /&gt;&lt;BR /&gt;Is there an HP-UX command that can do that?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Suren S.&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 15:23:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241641#M173752</guid>
      <dc:creator>Suren Selva_1</dc:creator>
      <dc:date>2004-04-06T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Any Date Into A 3-digit Decimal Number</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241642#M173753</link>
      <description>Well, if all you need is the current date then&lt;BR /&gt;&lt;BR /&gt;DAYS=$(date '+%j')&lt;BR /&gt;echo "Days = ${DAYS}"&lt;BR /&gt;&lt;BR /&gt;will do it.&lt;BR /&gt;&lt;BR /&gt;but if you want to be able to input the date, say in MO DAY YEAR order and the number you desire is a number in the range 1-366 then this should do it:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset -i10 MO=${1}&lt;BR /&gt;typeset -i10 DA=${2}&lt;BR /&gt;typeset -i10 YR=${3}&lt;BR /&gt;shift 3&lt;BR /&gt;typeset -i10 DAYS=$(($(caljd.sh ${MO} ${DA} ${YR} - $(caljd.sh 1 1 ${YR}) + 1))&lt;BR /&gt;echo "Days = ${DAYS}"&lt;BR /&gt;&lt;BR /&gt;You can also get a nice ordered number (though not 3 digits) with&lt;BR /&gt;caljd.sh MO DAY YR&lt;BR /&gt;&lt;BR /&gt;This would yield the number of days since 4712 BCE.&lt;BR /&gt;&lt;BR /&gt;Invoke as caljd.sh -u for full usage; you might also choose to simply yank out the cal_jdate function and use it.&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 15:37:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241642#M173753</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-06T15:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Any Date Into A 3-digit Decimal Number</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241643#M173754</link>
      <description>I suppose that if you must convert the output to a leading-zero padded result then a small modification is in order:&lt;BR /&gt;&lt;BR /&gt;typeset -i10 MO=${1}&lt;BR /&gt;typeset -i10 DA=${2}&lt;BR /&gt;typeset -i10 YR=${3}&lt;BR /&gt;shift 3&lt;BR /&gt;typeset -i10 DAYS=$(($(caljd.sh ${MO} ${DA} ${YR} - $(caljd.sh 1 1 ${YR}) + 1))&lt;BR /&gt;typeset -Z3 ZDAYS=${DAYS}&lt;BR /&gt;echo "Days = ${ZDAYS}"&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 16:29:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241643#M173754</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-06T16:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Any Date Into A 3-digit Decimal Number</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241644#M173755</link>
      <description>Hi Suren,&lt;BR /&gt;&lt;BR /&gt;Well if all you're looking for is the day of the year in a 3-digit output, the date command alone can do that - as follows:&lt;BR /&gt;&lt;BR /&gt;date +%j&lt;BR /&gt;&lt;BR /&gt;will give you that.&lt;BR /&gt;man date for details.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 06 Apr 2004 16:34:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241644#M173755</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-04-06T16:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Any Date Into A 3-digit Decimal Number</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241645#M173756</link>
      <description>Hi Clay,&lt;BR /&gt;&lt;BR /&gt;My goal is to be able to convert any date into a 3 or 4 digit number.&lt;BR /&gt;&lt;BR /&gt;There is a missing ')' in the script. Any idea where it should be?&lt;BR /&gt;&lt;BR /&gt;When I ran this script by assigning a ) at the end it hung my system.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Suren&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 16:39:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241645#M173756</guid>
      <dc:creator>Suren Selva_1</dc:creator>
      <dc:date>2004-04-06T16:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Any Date Into A 3-digit Decimal Number</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241646#M173757</link>
      <description>typeset -i10 DAYS=$(($(caljd.sh ${MO} ${DA} ${YR}) - $(caljd.sh 1 1 ${YR}) + 1))&lt;BR /&gt;typeset -Z3 ZDAYS=${DAYS}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The missing 'paren' was after the first ${YR}, the above should work.&lt;BR /&gt;&lt;BR /&gt;You really need to beter define your problem because it is not at all clear how you want to handle year boundaries.&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 16:44:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241646#M173757</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-06T16:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Any Date Into A 3-digit Decimal Number</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241647#M173758</link>
      <description>Suren,&lt;BR /&gt;&lt;BR /&gt;if you consider a period of a few years, it is impossible to convert a date to a 3 digit number without having duplicates (two dates having the same 3 digit number (or 4 digits). &lt;BR /&gt;&lt;BR /&gt;It seems to me a minimum requirement that all dates are given a unique number.&lt;BR /&gt;&lt;BR /&gt;So indeed you should refine your question.&lt;BR /&gt;&lt;BR /&gt;JP.</description>
      <pubDate>Wed, 07 Apr 2004 02:48:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-any-date-into-a-3-digit-decimal-number/m-p/3241647#M173758</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2004-04-07T02:48:36Z</dc:date>
    </item>
  </channel>
</rss>

