Re: note 9432 added to strtotime
| From: | J. M. Castagnetto | Date: | Fri, 03 Nov 2000 23:46:21 +0000 |
| Subject: | Re: note 9432 added to strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7365@lists.php.net to get a copy of this message | ||
I am adding the following to your note.
[Editor's note: MySQL does have a function to handle
the conversion UNIX_TIMESTAMP (read the MySQL manual
for more details). So, in reality there is no need to
do a post-query manipulation in this case, just ask
for "SELECT ..., UNIX_TIMESTAMP(datetime_field) ..."]
--- jcjollant@hotmail.com wrote:
> Here is a 1 line trick to convert a MySQL time into
> a timestamp :
>
> $time = mktime( substr( $sqltime, 0, 2), substr(
> $sqltime, 3, 2));
>
> Simple, but i didn't find it in the suggestions !
>
> http://www.php.net/manual/function.strtotime.php
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-notes-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
> .
> @lists.php.net
>
> .
>
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
__________________________________________________
Do You Yahoo!?
From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/