Re: DB_DataObject

From: Date: Mon, 25 Oct 2004 00:56:39 +0000
Subject: Re: DB_DataObject
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15086@lists.php.net to get a copy of this message
Edvan Cunha wrote:
I'm working with PostgreSQL and, when I execute a find(), all date fields on DB_DataObjects come with an undesired date format. How can I set the datestyle on the find() method of DataObjects?
DataObjects should use the native date style in the database, - there isnt anything magic done on find/fetching (unless you override those methods) eg. echo $do->{datecolumn}; however using the overloaded get{datecolumn}() methods, may run it through the Date class. (and defaults to ISO) you can use the overloaded methods to get formated dates, by using the strftime format as the argument in the get method. $date = $do->get{datecolumn}("%d/%m/%Y"); Regards Alan

« previous php.pear.general (#15086) next »