所以,我有一个date
数据类型存储在 MySQL 中的日期,以及我何时调用
echo $row_myRecordset['date']; // dreamweaver generated
它将以哪种日期格式返回日期(例如yy-mm-dd
),以便我可以将它与 moment.js 一起使用?
它是 yyyy-mm-dd,例如2013-07-21
(参见MySQL 参考)
它将返回YYYY-MM-DD
日期数据类型
应该是 YYYY-MM-DD hh:mm:ss
请参阅:http ://cookbooks.adobe.com/post_Format_dates_stored_in_MySQL-16641.html
首先,什么是moment.js用于mySQL 表示日期的元组类型是DATE 类型。您可以在此处阅读MySQL 文档
All depending on how you are getting the data back from the page you can manipulate the data to format it however you want it, hence that "special" formatting that could be applied in that Javascript file moments.js. So if I don't see how you manipulate the date in that specific file, I can't really help you. Please post some code.
Also : This shows lack of research ! Look at this Link explained here on stackoverflow.com