note 21542 deleted from function.mktime by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 20:33:49 +0000 |
| Subject: | note 21542 deleted from function.mktime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56248@lists.php.net to get a copy of this message | ||
Note Submitter: frans@noworkteam.net
----
If MySQL provides functions these are generally faster and easier to use then your own
'workaround' functions.
Example : timestamps.
Yes, MySQL uses another format than PHP. That's why MySQL has a function UNIX_TIMESTAMP(). Feed
it with a MySQL timestamp and you'll get the UNIX timestamp (php uses this format).
So you timestamped a record, and you need this value?
SELECT UNIX_TIMESTAMP(row) AS stamp, id....etc... FROM table LIMIT 10
You can use it in WHERE statements and so on....
For full docs see the MySQL site -> http://www.mysql.com/documentation/mysql/bychapter
/manual_Reference.html#Date_and_time_functions
Happy Coding!