PHP and MySQL syntax: Difference between revisions

Jump to navigation Jump to search
m
Line 4: Line 4:
Convert time stamp <--> the human readable time format
Convert time stamp <--> the human readable time format
=== now ===
=== now ===
the '''human readable''' time format ex: 2010-12-21 10:05:06
the '''human readable''' time format ex: {{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY2}} {{CURRENTTIME}}:06
* php: echo date("Y-m-d H:i:s", time() ); //Convert the time stamp of current time to the human readable time format. Ex: return '2010-12-21 10:05:06'
* php: echo date("Y-m-d H:i:s", time() ); //Convert the time stamp of current time to the human readable time format. Ex: return '2010-12-21 10:05:06'
* mysql: which mapping to DATETIME type<ref>[http://dev.mysql.com/doc/refman/5.1/en/datetime.html MySQL :: MySQL 5.1 Reference Manual :: 11.3.1 The DATE, DATETIME, and TIMESTAMP Types]</ref>
* mysql: which mapping to DATETIME type<ref>[http://dev.mysql.com/doc/refman/5.1/en/datetime.html MySQL :: MySQL 5.1 Reference Manual :: 11.3.1 The DATE, DATETIME, and TIMESTAMP Types]</ref>

Navigation menu