Re: note 9609 added to time
| From: | J. M. Castagnetto | Date: | Tue, 14 Nov 2000 23:08:41 +0000 |
| Subject: | Re: note 9609 added to time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7700@lists.php.net to get a copy of this message | ||
Or simply use the UNIX_TIMESTAMP() in MySQL, e.g.
"select *,unix_timestamp(tsfield) ...". See the MySQL
manual for more infomation.
I will add the comment above to your note.
--- andre.feld@gmx.de wrote:
> To convert a mysql timestamp (14 Byte) into a unix
> timestamp:
>
> // This function translates es mysql timestamp to //
> a unix timestamp
>
> function epoch($timestamp)
> {
> $hour = substr($timestamp,8,2);
> $minute = substr($timestamp,10,2);
> $second = substr($timestamp,12,2);
> $month = substr($timestamp,4,2);
> $day = substr($timestamp,6,2);
> $year = substr($timestamp,0,4);
> return mktime($hour, $minute, $second,
> $month, $day, $year);
> }
>
> http://www.php.net/manual/function.time.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
>
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/