Ram Ch. Bachkheti
Ram Ch. Bachkheti

Reputation: 2649

how to display int type value into date time in zend

I am converting date-time value into int datatype in MySQL database.my question is when i updating that value in zend form it display same integer value in my text box.How can i convert that int value into date time format when i display that value in update form.

Upvotes: 1

Views: 146

Answers (1)

Alex Pliutau
Alex Pliutau

Reputation: 21937

If your INT - is a Unix time stamp, use the following code:

$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

Upvotes: 1

Related Questions