RE: [PHP] convertion from string to time & substracting
| From: | John Holmes | Date: | Fri, 07 Jun 2002 18:17:37 +0000 |
| Subject: | RE: [PHP] convertion from string to time & substracting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101159@lists.php.net to get a copy of this message | ||
Is there a reason you insist on using a CHAR field, instead of a TIME
field, which would make this all easier and allow you to use the
multitude of MySQL Date and Time Functions in your query... ???
---John Holmes...
> -----Original Message-----
> From: juaid [mailto:juaid@juanin.com]
> Sent: Friday, June 07, 2002 2:02 PM
> To: php-general@lists.php.net
> Subject: [PHP] convertion from string to time & substracting
>
> Hi,
>
> sorry if maybe this is a bit dumb question, but I'm a begginer with
php...
>
> I got a mysql database, where two of the fields of a table record
times as
> CHAR(8) in the format hh:mm:ss
>
> I want to take this two times and get the difference between them in
> seconds, for example 12:01:30 - 12:00:00 = 90
> I looked up at the doc in the php.net website and couldn't get on how
to
> do
> this... should I use the strtotime function?
>
> anyone has donde something like this, or knows what functions could
help
> me
> to do this?
>
> Thanks in advance,
>
> juaid
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php