Date: Mon, 19 Nov 2001 01:36:14 -0800 From: "Crist J. Clark" <cristjc@earthlink.net> To: Chris Aitken <chris@ideal.net.au> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Epoch Time on Freebsd with perl Message-ID: <20011119013614.K69555@blossom.cjclark.org> In-Reply-To: <5.1.0.14.2.20011119163225.01f5b130@mail.ideal.net.au>; from chris@ideal.net.au on Mon, Nov 19, 2001 at 04:37:27PM %2B1100 References: <5.1.0.14.2.20011119163225.01f5b130@mail.ideal.net.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 19, 2001 at 04:37:27PM +1100, Chris Aitken wrote: > 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. $ man Time::Local -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org 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?20011119013614.K69555>