RE: [PHP-DB] odbc date
| From: | Andrew Hill | Date: | Mon, 31 Dec 2001 18:20:51 +0000 |
| Subject: | RE: [PHP-DB] odbc date | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15284@lists.php.net to get a copy of this message | ||
George,
Yes, using the date() example.
Cheers,
Andrew
> -----Original Message-----
> From: George Nicolae [mailto:geomasterweb@hotmail.com]
> Sent: Monday, December 31, 2001 1:26 PM
> To: php-db@lists.php.net
> Subject: Re: [PHP-DB] odbc date
>
>
> it is right but I want to select all data from a mdbdatabase table and I
> receive in 'yyyy/mm/dd hh:mm:ss' format.
> I told you I resolve this problem with date("F j,
> Y",strtotime(odbc_result($cur,"date"))).
> I what to know if I can receive a specific format from query "select date
> from my_table"
>
> --
>
>
> Best regards,
> George Nicolae
> IT Manager
> ___________________
> X-Playin - Professional Web Design
> www.x-playin.f2s.com
>
>
>
> "Andrew Hill" <ahill@openlinksw.com> wrote in message
> news:NDBBKFNCBCHANEGAKONKAEENLMAA.ahill@openlinksw.com...
> > 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
> > >
> > >
> > >
> >
> >
>
>
>
> --
> 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
>
>
>