<?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 Time calculation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839786#M90897</link>
    <description>Any way to calculate the difference between a file date creation and current date? This difference will be able to being of hours or fraction.&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
    <pubDate>Wed, 06 Nov 2002 12:20:45 GMT</pubDate>
    <dc:creator>Jose Mosquera</dc:creator>
    <dc:date>2002-11-06T12:20:45Z</dc:date>
    <item>
      <title>Time calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839786#M90897</link>
      <description>Any way to calculate the difference between a file date creation and current date? This difference will be able to being of hours or fraction.&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Wed, 06 Nov 2002 12:20:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839786#M90897</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2002-11-06T12:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Time calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839787#M90898</link>
      <description>Jose,&lt;BR /&gt;&lt;BR /&gt;Search the forums for "date hammer" or just wait a while and Mr Hammer (otherwise known as A. Clay Stephenson) will be along to explain caljd.sh to you.&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 06 Nov 2002 12:44:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839787#M90898</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-11-06T12:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Time calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839788#M90899</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This very simple C program (not enough controls on args and return codes) could do it ...&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;&lt;BR /&gt;main (argc, argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;  time_t t_now;&lt;BR /&gt;  int days,hours,minutes,seconds;&lt;BR /&gt;  struct stat bufstat;&lt;BR /&gt;&lt;BR /&gt;  if (stat(argv[1], &amp;amp;bufstat) != 0)&lt;BR /&gt;  {&lt;BR /&gt;    perror("stat");&lt;BR /&gt;    exit(1);&lt;BR /&gt;  }&lt;BR /&gt;  time(&amp;amp;t_now);&lt;BR /&gt;  seconds=(int)(t_now - bufstat.st_mtime);&lt;BR /&gt;  days=seconds / 86400;&lt;BR /&gt;  seconds=seconds % 86400;&lt;BR /&gt;  hours=seconds / 3600;&lt;BR /&gt;  seconds=seconds % 3600;&lt;BR /&gt;  minutes=seconds / 60;&lt;BR /&gt;  seconds=seconds % 60;&lt;BR /&gt;  printf("'%s' has been modified %d days %d hours %s minutes %d seconds ago\n",&lt;BR /&gt;    argv[1], days, hours, minutes, seconds);&lt;BR /&gt;}&lt;BR /&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Wed, 06 Nov 2002 13:07:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839788#M90899</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-11-06T13:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Time calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839789#M90900</link>
      <description>Hi&lt;BR /&gt;you can also use perl:&lt;BR /&gt;&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;use File::stat;&lt;BR /&gt; &lt;BR /&gt;$st = stat($ARGV[0]) or die "No $file: $!";&lt;BR /&gt;$diff=time()-$st-&amp;gt;mtime;&lt;BR /&gt;print "diff=$diff s\n";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;to convert the seconds in Days/Hours/Minutes you can use the same syntax as Jean-Louis in his c-program&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 06 Nov 2002 13:28:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839789#M90900</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-11-06T13:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Time calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839790#M90901</link>
      <description>This is for modification time. -C and -A also available, but -M is probably what you want&lt;BR /&gt;&lt;BR /&gt;a5:/tmp 112 &amp;gt; perl -e'printf"%8.2f %s\n",24*-M$_,$_ for@ARGV' xx*&lt;BR /&gt;  165.22 xx&lt;BR /&gt;    0.26 xx.A&lt;BR /&gt; 2043.71 xx.L&lt;BR /&gt; 2573.41 xx.c&lt;BR /&gt; 2567.42 xx.c.idx&lt;BR /&gt;  486.43 xx.pl&lt;BR /&gt; 1325.97 xx.sql&lt;BR /&gt;    0.29 xxfin&lt;BR /&gt; 1847.94 xxx&lt;BR /&gt;a5:/tmp 113 &amp;gt; ll xx*&lt;BR /&gt;    118 -rw-rw-rw-    1 merijn   softwr      15360 Oct 30 17:19 xx&lt;BR /&gt;    515 -rw-rw-rw-    1 gert     softwr       4054 Nov  6 14:17 xx.A&lt;BR /&gt;    290 -rw-rw-rw-    1 merijn   softwr       8712 Aug 13 11:50 xx.L&lt;BR /&gt;    209 -rw-rw-rw-    1 merijn   softwr        227 Jul 22 10:08 xx.c&lt;BR /&gt;    253 -rw-rw-rw-    1 merijn   softwr      24576 Jul 22 16:07 xx.c.idx&lt;BR /&gt;    171 -rw-rw-rw-    1 merijn   softwr        221 Oct 17 09:07 xx.pl&lt;BR /&gt;    192 -rw-rw-rw-    1 linda    softwr        164 Sep 12 09:34 xx.sql&lt;BR /&gt;    358 -rw-rw-rw-    1 henk     softwr      16470 Nov  6 14:15 xxfin&lt;BR /&gt;    276 -rw-rw-rw-    1 merijn   softwr         49 Aug 21 15:36 xxx&lt;BR /&gt;a5:/tmp 114 &amp;gt;</description>
      <pubDate>Wed, 06 Nov 2002 13:34:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-calculation/m-p/2839790#M90901</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-11-06T13:34:12Z</dc:date>
    </item>
  </channel>
</rss>

