Watch out, though, as "direct date math" can really screw ya over
when it Daylight Savings changes (if you're not in a daylight savings
area, you're okay.)  Best bet is to use getdate() to build up the array,
modify the array elements, then mktime it.  If you just add seconds
you'll get odd results when traversing daylight savings.

-Mike

----- Original Message ----- 
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 25, 2002 1:47 PM
Subject: Re: [PHP-DB] Time difference question...


> Versions above just before 4.0 of MySQL can handle direct date math.
> 
> Try SELECT date_returned - date_paged FROM pagetable;
> 
> It'll work if you have values "date_returned" and "date_paged" in the table 
>"pagetable" of course :o)
> 
> HTH
> 
> Martin
> 
> >>> "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]> 06/25/02 04:40PM >>>
> I am working on a Call Log application, and need to calculate time.
> For example, if a page is received at 12:00, the page is returned at 12:10,
> and the call is resolved at 14:30...  I need to be able to calculate the
> time to return the page, and also the time to resolve the call.  I am not
> sure if PHP provides a function to handle date/time math.  I know that MySQL
> can add and subtract a fixed interval to a date/time, but I am not sure if
> it can deal with math involving a pair of date/time values.  Thanks in
> advance.
> 
> Scott Nipp
> Phone:  (214) 858-1289
> E-mail:  [EMAIL PROTECTED] 
> Web:  http:\\ldsa.sbcld.sbc.com
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to