Unix Timestamp unix Timestamp (the number of seconds after ' 1970-01-01 00:00:00 ' GMT)
Js
var strtime = ' 2014-04-23 18:55:49:123 '; var New // Pass in a time format date.gettime (); // Change to UNIX timestamp except for
Php
$ts Time // Current time stamp int $ti Date $ts // date and time in RFC 2822 format, $TF Date // custom Format, the second parameter is the default current timestamp//followed by two is a string $ts Strtotime // String Conversion Time
Mysql
Timestamp field representation is more like a string
SELECTDate from Table //php read out date is a stringINSERT Table SetDate='2017-11-2 10:10:10'UPDATE Table SetDate='2017-11-2 10:10:10' whereId=1 ///Two field input is a string, PHP use the date function to pass after the conversion
Use:
1. MySQL takes out the string:
1, can directly through the JS can directly convert the date into JS timestamp
2, with PHP strtotime loaded with time stamp, JS *1000 to replace JS timestamp
2, JS pass time stamp, PHP with date loaded into string, to MySQL
See
PHP MySQL http://www.cnblogs.com/mitang/p/3603823.html
JS http://www.cnblogs.com/mitang/p/5605712.html
PHP Date http://php.net/manual/zh/function.date.php
PHP strtotime http://php.net/manual/zh/function.strtotime.php
Time stamp JS PHP MYSQL