Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computers:mysql_date_validation_and_conversion [2009/08/11 17:24]
daniel
computers:mysql_date_validation_and_conversion [2015/03/24 05:42] (current)
Line 9: Line 9:
 $unixtime = time(); ​ //$unixtime is seconds from 1/1/1970, e.g. '​1249979071'​. $unixtime = time(); ​ //$unixtime is seconds from 1/1/1970, e.g. '​1249979071'​.
  
-//mysql datetime field, may omit $unixtime, i.e. date('​Y-m-d H:​i:​s'​);​+//mysql datetime field, may omit $unixtime ​if you need the current time-date
 $mysqldate = date( 'Y-m-d H:​i:​s',​ $unixtime );  $mysqldate = date( 'Y-m-d H:​i:​s',​ $unixtime );