<?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 converting 'last' and 'lastb' date string in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815763#M392809</link>
    <description>&lt;P&gt;Can anyone think of a quick and easy way to convert the date and time stamp in the wtmp/btmp entries so that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Mon Jun&amp;nbsp; 6 20:46 ﻿"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"2011/06/06 20:46:00"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're using Net-Syslog-0.04﻿ to send last/lastb output to ArcSight, perhaps someone is already doing this so that we don't have to reinvent the wheel?&amp;nbsp; :)&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2011 15:13:08 GMT</pubDate>
    <dc:creator>ca25089</dc:creator>
    <dc:date>2011-07-06T15:13:08Z</dc:date>
    <item>
      <title>converting 'last' and 'lastb' date string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815763#M392809</link>
      <description>&lt;P&gt;Can anyone think of a quick and easy way to convert the date and time stamp in the wtmp/btmp entries so that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Mon Jun&amp;nbsp; 6 20:46 ﻿"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"2011/06/06 20:46:00"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're using Net-Syslog-0.04﻿ to send last/lastb output to ArcSight, perhaps someone is already doing this so that we don't have to reinvent the wheel?&amp;nbsp; :)&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2011 15:13:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815763#M392809</guid>
      <dc:creator>ca25089</dc:creator>
      <dc:date>2011-07-06T15:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: converting 'last' and 'lastb' date string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815803#M392810</link>
      <description>&lt;P&gt;If you want to roll your own, then you'll need something along the (perl example) lines of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;use strict;

my $y=1900+(localtime)[5];     # Pick up the current year
while (&amp;lt;&amp;gt;) {                   # for this example read terst data from stdin
  m /\s*\w+\s+(\w+)\s+(\d+)\s+(\S+)/;  # Match it!
  my $m=index( q(   JanFebMarAprMayJunJulAugSepOctNovDec),$1)/3; # Calculate month
  printf qq(%4d/%02d/%02d %s:00\n), $y, $m, $2, $3;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Just as easily done in Awk or shell.&lt;/P&gt;&lt;P&gt;You may have to teachit to&amp;nbsp;become&amp;nbsp;timezone, and language aware.&lt;/P&gt;&lt;P&gt;Google for&amp;nbsp;strftime﻿ and such functions for more help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hein&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2011 15:42:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815803#M392810</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2011-07-06T15:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: converting 'last' and 'lastb' date string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815889#M392812</link>
      <description>&lt;P&gt;I'm not sure if fwtmp(1M)﻿ output has a better date format?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2011 16:36:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815889#M392812</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-07-06T16:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: converting 'last' and 'lastb' date string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815917#M392814</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I agree with Dennis.&amp;nbsp; Using 'fwtmp' will also show the timestamp's in Epoch seconds which then becomes easily reformatted using 'strftime()' to any format you desire.&amp;nbsp; This also has the advantage of computing the correct year when 6-months of records cross a year's boundry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# perl -MPOSIX -le 'print strftime "%m/%d/%Y %T",localtime(1309971149)'&lt;BR /&gt;07/06/2011 12:52:29&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2011 16:55:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815917#M392814</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-07-06T16:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: converting 'last' and 'lastb' date string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815939#M392816</link>
      <description>&lt;P&gt;Thanks to everyone who replied, these are great ideas and I will work off of these.&amp;nbsp; Appreciate the help!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2011 17:07:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/converting-last-and-lastb-date-string/m-p/4815939#M392816</guid>
      <dc:creator>ca25089</dc:creator>
      <dc:date>2011-07-06T17:07:01Z</dc:date>
    </item>
  </channel>
</rss>

