From owner-freebsd-questions Thu Dec 5 11: 0:23 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4235E37B401 for ; Thu, 5 Dec 2002 11:00:22 -0800 (PST) Received: from homer.bignose.ca (static-89-42.dsl.tht.net [216.126.89.42]) by mx1.FreeBSD.org (Postfix) with SMTP id D3DBA43EBE for ; Thu, 5 Dec 2002 11:00:20 -0800 (PST) (envelope-from jeff@interchange.ca) Received: (qmail 31288 invoked from network); 5 Dec 2002 18:59:22 -0000 Received: from unknown (HELO jeffmfgsfzhqjc) (192.168.0.2) by 192.168.0.1 with SMTP; 5 Dec 2002 18:59:22 -0000 From: "Jeff MacDonald" To: "Eric Six" , Subject: RE: Perl question... calculating difference in time.. Date: Thu, 5 Dec 2002 14:00:20 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG look into the perl module Date::Calc, it's has ALOT of features that are quite useful for date manipulation. jeff. > -----Original Message----- > From: owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Eric Six > Sent: Thursday, December 05, 2002 1:44 PM > To: 'freebsd-questions@FreeBSD.ORG' > Subject: Perl question... calculating difference in time.. > > > I know this isn't a perl list, but this is a perl on freebsd question! ;) > > I have a script that is sorting log files. I want to calculate the total > time between log entrys. Here is the format of the log files: > > Dec 05 09:51:48.452 info info.info data > ... > Dec 05 09:53:49.543 info info.info data > > The output should return something along the lines of: total time between > log entries 02:01:01.091. > > I have the time fields pulled out but I cannot figure out how to seprate > them into a calculatable format. And if this was run from after > midnight and > the log files rolled back to 23:00, how to calculate this..Any > help is much > appreciated! > > TIA > Eric > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message