PHP and MySQL syntax: Difference between revisions

Jump to navigation Jump to search
Line 30: Line 30:


convert human-readable time to '''timestamp'''
convert human-readable time to '''timestamp'''
* php:[http://php.net/manual/en/function.strtotime.php strtotime()]
* php: using [http://php.net/manual/en/function.strtotime.php strtotime()] function ex: strtotime('2010-12-21 10:05:06') <ref>[http://stackoverflow.com/questions/113829/how-to-convert-date-to-timestamp-in-php How to convert date to timestamp in PHP? - Stack Overflow]</ref>
* mysql: SELECT UNIX_TIMESTAMP('2011-03-15 18:53:57'); /* return timestamp: 1300186437 */
* mysql: SELECT UNIX_TIMESTAMP('2011-03-15 18:53:57'); /* return timestamp: 1300186437 */


Navigation menu