RE: [PHP-DB] odbc date

From: Date: Mon, 31 Dec 2001 18:07:40 +0000
Subject: RE: [PHP-DB] odbc date
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15282@lists.php.net to get a copy of this message
George, The ODBC date syntax is best used for to make input format unambiguous, e.g.: select * from orders where order_date = { d '2002-01-01'} This will allow you to select from a table regardless of the date format. For converting a date from one format to another, select it from a table and then use the PHP date() function to convert, e.g.: while (list ($timestamp) = each ($result_array)) { $new_format = date(Y-m-d, $timestamp); echo "$new_format<br>"; } Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -----Original Message----- > From: George Nicolae [mailto:geomasterweb@hotmail.com] > Sent: Monday, December 31, 2001 12:51 PM > To: php-db@lists.php.net > Subject: Re: [PHP-DB] odbc date > > > i did it with date("F j, Y",strtotime(odbc_result($cur,"date"))). > but i very curios about the query. it must looke like..? > select date from my_table????? > > -- > > > Best regards, > George Nicolae > IT Manager > ___________________ > X-Playin - Professional Web Design > www.x-playin.f2s.com > > > > > > Or you can format it with odbc date syntax in your query { d > 'YYYY-MM-DD' } > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.db (#15282) next »