View Single Post
  #8 (permalink)  
Old 11-28-2007, 04:34 AM
conradwt conradwt is offline
Junior Member
 
Join Date: Nov 2007
Posts: 26
Default Re: Getting the date format

Quote:
Originally Posted by Elemental View Post
re: mosh

did you find a way to get what you were after?

re: conradwt

Zend_Date::now() returns a Zend_Date object, you need to turn it into a timestamp or string via:

Code:
Zend_Date::now()->toString();
//or
Zend_Date::now()->getTimestamp();
note: toString() takes formatting, locale and something else as parameters, check the api docs at zend.com for details.
Hi, I was able to find the following in the reference documentation:

PHP Code:
new Zend_Db_Expr('NOW()'
However, it seems that the toString method is called when I invoke the following test action:

PHP Code:
function dateAction()
{
   
$this->view->current_date Zend_Date::now();

Now, when I invoke the action (i.e. http://localhost/my_app/public/admin/date ), it prints the time and the date as I would expect. In any case, I'll try your method of obtaining the timestamp from the Date instance.

Thanks again,

-Conrad
Reply With Quote