Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在将日期时间值转换为 MySQL 数据库中的 int 数据类型。我的问题是,当我以 zend 形式更新该值时,它会在我的文本框中显示相同的整数值。当我显示该 int 值时,如何将该值转换为日期时间格式更新形式的值。
如果您的 INT - 是 Unix 时间戳,请使用以下代码:
$timestamp = 1349079306; $date = new Zend_Date($timestamp); echo $date->get(Zend_Date::ATOM); // all constants here : http://framework.zend.com/manual/1.12/en/zend.date.constants.html