From owner-freebsd-questions Sun Nov 18 21:37:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.ideal.net.au (ion.ideal.net.au [203.20.241.5]) by hub.freebsd.org (Postfix) with ESMTP id DF77A37B416 for ; Sun, 18 Nov 2001 21:37:35 -0800 (PST) Received: from helium.ideal.net.au (helium.staff.ideal.net.au [202.3.35.2]) by mail.ideal.net.au (8.9.3/8.9.3) with ESMTP id QAA10795 for ; Mon, 19 Nov 2001 16:37:27 +1100 (EST) (envelope-from chris@ideal.net.au) Message-Id: <5.1.0.14.2.20011119163225.01f5b130@mail.ideal.net.au> X-Sender: chris@mail.ideal.net.au X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 19 Nov 2001 16:37:27 +1100 To: freebsd-questions@FreeBSD.ORG From: Chris Aitken Subject: Epoch Time on Freebsd with perl Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed 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 Hi all, Something im trying to play with is this. Im pulling 2 date/time variables from a database, and what im trying to do is work out a comparison between the both dates..... for example $date1 = "2001-10-01 01:00:00"; $date2 = "2001-10-01 03:00:00"; What I want is to somehow calculate that there is 2 hours between these 2 dates (or 120 minutes, or 7200 seconds etc etc) I know I can do a time() and it will return the number of seconds from epoch, but it only works on live time, and I cant feed it a date and let it calculate it on that. Any help on this would be appreciated. Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: chris@ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 __-----------------------------------------__ # ln -s /dev/null /bin/laden If you don't like my typing, all flames to /bin/laden To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message