<?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: calculation date in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508015#M705332</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Create a directory.&lt;BR /&gt;&lt;BR /&gt;# mkdir /tmp/time&lt;BR /&gt;# vi time.c&lt;BR /&gt;        main(argc, argv)&lt;BR /&gt;&lt;BR /&gt;        int argc;&lt;BR /&gt;        char **argv;&lt;BR /&gt;        {&lt;BR /&gt;         time_t foo;&lt;BR /&gt;         foo = atoi(argv[1]);&lt;BR /&gt;         printf("%s",ctime(&amp;amp;foo));&lt;BR /&gt;        }&lt;BR /&gt;# cc time.c&lt;BR /&gt;this will create a file called a.out&lt;BR /&gt;# ./a.out 891712421&lt;BR /&gt;Sat Apr  4 19:53:41 1998&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
    <pubDate>Mon, 21 Mar 2005 04:54:06 GMT</pubDate>
    <dc:creator>Robert-Jan Goossens</dc:creator>
    <dc:date>2005-03-21T04:54:06Z</dc:date>
    <item>
      <title>calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508009#M705326</link>
      <description>hi all&lt;BR /&gt;&lt;BR /&gt;i want to make a date calculation.&lt;BR /&gt;i have database informix with column include&lt;BR /&gt;the date (seconds from first january 1970).&lt;BR /&gt;&lt;BR /&gt;when i get the value from this column .the result like that&lt;BR /&gt;------------------&lt;BR /&gt;856775871&lt;BR /&gt;845717763&lt;BR /&gt;938508910&lt;BR /&gt;938508912&lt;BR /&gt;-------------------&lt;BR /&gt;how can convert this integer values to date?&lt;BR /&gt;&lt;BR /&gt;thankx&lt;BR /&gt;</description>
      <pubDate>Sat, 19 Mar 2005 09:39:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508009#M705326</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-03-19T09:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508010#M705327</link>
      <description>strftime&lt;BR /&gt;&lt;BR /&gt;live free or die &lt;BR /&gt;harry d brown jr</description>
      <pubDate>Sat, 19 Mar 2005 09:54:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508010#M705327</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-03-19T09:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508011#M705328</link>
      <description>Hi,&lt;BR /&gt;hmm - looks like old files to me, but try this:&lt;BR /&gt;# NUMBER=856775871&lt;BR /&gt;#  echo 0d$NUMBER=Y|adb&lt;BR /&gt;&lt;BR /&gt;which gives the result shown below on my system. It will probably give a different result on yours as the TZ value is added to the time:&lt;BR /&gt;      1997 Feb 24 10:17:51&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 19 Mar 2005 11:23:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508011#M705328</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-03-19T11:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508012#M705329</link>
      <description>Hi kamal ,&lt;BR /&gt;&lt;BR /&gt;to change the valeus to date you can use the command one by one:&lt;BR /&gt;&lt;BR /&gt;#ctime 856775871&lt;BR /&gt;Mon Feb 24 10:17:51 1997&lt;BR /&gt;&lt;BR /&gt;#ctime 845717763&lt;BR /&gt;Sat Oct 19 11:36:03 1996&lt;BR /&gt;&lt;BR /&gt;#ctime 938508910&lt;BR /&gt;Tue Sep 28 10:55:10 1999&lt;BR /&gt;&lt;BR /&gt;#ctime 938508912&lt;BR /&gt;Tue Sep 28 10:55:12 1999&lt;BR /&gt;&lt;BR /&gt;Than you can create  a script to do it automatically for all values.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Taulant&lt;BR /&gt;</description>
      <pubDate>Sun, 20 Mar 2005 06:46:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508012#M705329</guid>
      <dc:creator>Taulant Shamo</dc:creator>
      <dc:date>2005-03-20T06:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508013#M705330</link>
      <description>Hi Kamal,&lt;BR /&gt;&lt;BR /&gt;you can create the script changetime.sh&lt;BR /&gt;like below:&lt;BR /&gt;Example:&lt;BR /&gt;if you have the file data.txt in home directory like below:&lt;BR /&gt;------------------------------&lt;BR /&gt;#cat data.txt&lt;BR /&gt;856775871&lt;BR /&gt;845717763&lt;BR /&gt;938508910&lt;BR /&gt;938508912&lt;BR /&gt;--------------------------- &lt;BR /&gt;&lt;BR /&gt;---------------------------&lt;BR /&gt;#cat changetime.sh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while read line &lt;BR /&gt;do ctime $line | tee $HOME/dataout.date&lt;BR /&gt;done&amp;lt;$HOME/data.txt&lt;BR /&gt;---------------------------&lt;BR /&gt;&lt;BR /&gt;#chmod 744 changetime.sh&lt;BR /&gt;&lt;BR /&gt;---------------------------&lt;BR /&gt;Run the script:&lt;BR /&gt;#changetime.sh&lt;BR /&gt;Mon Feb 24 10:17:51 1997&lt;BR /&gt;Sat Oct 19 11:36:03 1996&lt;BR /&gt;Tue Sep 28 10:55:10 1999&lt;BR /&gt;Tue Sep 28 10:55:12 1999&lt;BR /&gt;-----------------------------&lt;BR /&gt;&lt;BR /&gt;The script read line by line the file data.txt and run the command ctime for each line than the output is redirected to screen and even in the file dataout.date&lt;BR /&gt;&lt;BR /&gt;---------------------------&lt;BR /&gt;#cat dataout.date&lt;BR /&gt;Mon Feb 24 10:17:51 1997&lt;BR /&gt;Sat Oct 19 11:36:03 1996&lt;BR /&gt;Tue Sep 28 10:55:10 1999&lt;BR /&gt;Tue Sep 28 10:55:12 1999&lt;BR /&gt;--------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Taulant&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 20 Mar 2005 07:22:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508013#M705330</guid>
      <dc:creator>Taulant Shamo</dc:creator>
      <dc:date>2005-03-20T07:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508014#M705331</link>
      <description>many thankx for response&lt;BR /&gt;&lt;BR /&gt;but when i tryed command&lt;BR /&gt;-----------------&lt;BR /&gt;ctime 891712421&lt;BR /&gt;-----------------&lt;BR /&gt;error appear:  sh: ctime:  not found&lt;BR /&gt;why ctime dosen't work with me&lt;BR /&gt;&lt;BR /&gt;i login with root user&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2005 04:31:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508014#M705331</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-03-21T04:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508015#M705332</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Create a directory.&lt;BR /&gt;&lt;BR /&gt;# mkdir /tmp/time&lt;BR /&gt;# vi time.c&lt;BR /&gt;        main(argc, argv)&lt;BR /&gt;&lt;BR /&gt;        int argc;&lt;BR /&gt;        char **argv;&lt;BR /&gt;        {&lt;BR /&gt;         time_t foo;&lt;BR /&gt;         foo = atoi(argv[1]);&lt;BR /&gt;         printf("%s",ctime(&amp;amp;foo));&lt;BR /&gt;        }&lt;BR /&gt;# cc time.c&lt;BR /&gt;this will create a file called a.out&lt;BR /&gt;# ./a.out 891712421&lt;BR /&gt;Sat Apr  4 19:53:41 1998&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Mon, 21 Mar 2005 04:54:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508015#M705332</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2005-03-21T04:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: calculation date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508016#M705333</link>
      <description>The easist and most straightforward way to do this is via Perl's localtime() (or gmtime()) function.&lt;BR /&gt;&lt;BR /&gt;perl -e 'print scalar localtime(856775871)'</description>
      <pubDate>Mon, 21 Mar 2005 09:58:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculation-date/m-p/3508016#M705333</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-21T09:58:22Z</dc:date>
    </item>
  </channel>
</rss>

