Date: Mon, 19 Nov 2001 16:37:27 +1100 From: Chris Aitken <chris@ideal.net.au> To: freebsd-questions@FreeBSD.ORG Subject: Epoch Time on Freebsd with perl Message-ID: <5.1.0.14.2.20011119163225.01f5b130@mail.ideal.net.au>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.2.20011119163225.01f5b130>
