<?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 conversion in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569843#M228013</link>
    <description>hi hurd &lt;BR /&gt;&lt;BR /&gt;added to my previous mail&lt;BR /&gt;&lt;BR /&gt;The following PERL one-liner also prints the seconds since the start of&lt;BR /&gt;the epoch:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/opt/perl/bin/perl -e '$epoch = time; print "$epoch\n";'&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Vinod K</description>
    <pubDate>Thu, 23 Jun 2005 18:53:14 GMT</pubDate>
    <dc:creator>vinod_25</dc:creator>
    <dc:date>2005-06-23T18:53:14Z</dc:date>
    <item>
      <title>Date conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569837#M228007</link>
      <description>Is there a command that will convert the output from `date` to seconds since the epoch and then back?</description>
      <pubDate>Thu, 23 Jun 2005 16:12:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569837#M228007</guid>
      <dc:creator>Jayson B. Hurd</dc:creator>
      <dc:date>2005-06-23T16:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569838#M228008</link>
      <description>The answer to all your date conversion woes is here if you prefer shell version:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://mirrors.develooper.com/hpux/caljd-2.23.sh" target="_blank"&gt;http://mirrors.develooper.com/hpux/caljd-2.23.sh&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and here if you prefer perl version:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://mirrors.develooper.com/hpux/caljd-2.2.pl" target="_blank"&gt;http://mirrors.develooper.com/hpux/caljd-2.2.pl&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;thanks to A. Clay Stephenson of these forums.</description>
      <pubDate>Thu, 23 Jun 2005 16:15:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569838#M228008</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-06-23T16:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569839#M228009</link>
      <description>You don't really need it. See my answer to your previos post. The answer to this question&lt;BR /&gt;&lt;BR /&gt;is Perl's time and localtime functions.</description>
      <pubDate>Thu, 23 Jun 2005 16:23:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569839#M228009</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-23T16:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569840#M228010</link>
      <description>If you really really need it in a dedicated script, here is how I do it:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;#&lt;BR /&gt;#  display # of seconds since 1/1/1970 00:00:00 GMT&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;/usr/bin/date -u '+%y:%j:%H:%M:%S' | IFS=: read YR DAY HR MIN SEC&lt;BR /&gt;&lt;BR /&gt;print $(((YR*365+YR/4+((YR%4)&amp;gt;0)+DAY+10956)*86400+(HR*3600+MIN*60+SEC)))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and in case last line breaks due to length, print and everything after that is on one single line</description>
      <pubDate>Thu, 23 Jun 2005 16:29:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569840#M228010</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-06-23T16:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569841#M228011</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;typeset -i NOW=$(perl -e 'print time()')&lt;BR /&gt;echo "Epoch seconds = ${NOW}"&lt;BR /&gt;(( NOW -= 300 )) # subtract 5 minutes&lt;BR /&gt;echo "Epoch seconds - 5 minutes = ${NOW}"&lt;BR /&gt;&lt;BR /&gt;typeset DT=$(perl "print scalar localtime(${NOW})")&lt;BR /&gt;echo "Date 5 minutes ago = ${DT}"&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2005 16:35:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569841#M228011</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-23T16:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569842#M228012</link>
      <description>Hi Hurd,&lt;BR /&gt;&lt;BR /&gt;if i have taken your question right...&lt;BR /&gt;&lt;BR /&gt;try&lt;BR /&gt;&lt;BR /&gt;# date +%s&lt;BR /&gt;&lt;BR /&gt;if this served ur query update me&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Vinod K</description>
      <pubDate>Thu, 23 Jun 2005 18:49:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569842#M228012</guid>
      <dc:creator>vinod_25</dc:creator>
      <dc:date>2005-06-23T18:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569843#M228013</link>
      <description>hi hurd &lt;BR /&gt;&lt;BR /&gt;added to my previous mail&lt;BR /&gt;&lt;BR /&gt;The following PERL one-liner also prints the seconds since the start of&lt;BR /&gt;the epoch:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/opt/perl/bin/perl -e '$epoch = time; print "$epoch\n";'&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Vinod K</description>
      <pubDate>Thu, 23 Jun 2005 18:53:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-conversion/m-p/3569843#M228013</guid>
      <dc:creator>vinod_25</dc:creator>
      <dc:date>2005-06-23T18:53:14Z</dc:date>
    </item>
  </channel>
</rss>

