From owner-freebsd-questions Mon Nov 19 13: 0:42 2001 Delivered-To: freebsd-questions@freebsd.org Received: from yertle.kciLink.com (yertle.kcilink.com [216.194.193.105]) by hub.freebsd.org (Postfix) with ESMTP id BAFBC37B416 for ; Mon, 19 Nov 2001 13:00:39 -0800 (PST) Received: from onceler.kciLink.com (onceler.kciLink.com [216.194.193.106]) by yertle.kciLink.com (Postfix) with ESMTP id E2B2A1E841 for ; Mon, 19 Nov 2001 16:00:33 -0500 (EST) Received: (from khera@localhost) by onceler.kciLink.com (8.11.6/8.11.6) id fAJL0XX56384 for freebsd-questions@freebsd.org; Mon, 19 Nov 2001 16:00:33 -0500 (EST) (envelope-from khera) Date: Mon, 19 Nov 2001 16:00:33 -0500 (EST) Message-Id: <200111192100.fAJL0XX56384@onceler.kciLink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii From: Vivek Khera To: freebsd-questions@freebsd.org Subject: Re: Epoch Time on Freebsd with perl Newsgroups: ml.freebsd.questions References: <87n11i34u7.fsf@ralf.artlogix.com> X-Trace: lorax.kciLink.com 1006203098 40164 216.194.193.106 (19 Nov 2001 20:51:38 GMT) X-Complaints-To: daemon@kciLink.com 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 >>>>> "KM" == Ken McGlothlen writes: KM> Someone whose name has been removed to protect the innocent writes: KM> | > [Chris Aitken writes] KM> | > $date1 = "2001-10-01 01:00:00"; KM> | > $date2 = "2001-10-01 03:00:00"; KM> | > KM> | > What I want is to somehow calculate that there is 2 hours between these 2 KM> | > dates (or 120 minutes, or 7200 seconds etc etc) [in Perl] KM> | > Any help on this would be appreciated. KM> | KM> | Depending on your database you could do this in SQL, I would recommend KM> | RTFMing its docs. KM> That deserves *some* kind of prize for possibly the least KM> efficient solution to a problem ever posted on the list. Why? The original poster was pulling the information *from* a database, so it seems most sensible to make the database compute the time difference during the fetch. It seems most efficient to me. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D. Khera Communications, Inc. Internet: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message