RE: [PHP-DB] odbc date

2001-12-31 Thread Andrew Hill

George,

You can use the date() function in PHP to change the format:
http://www.php.net/manual/en/function.date.php

Or you can format it with odbc date syntax in your query { d '-MM-DD' }

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:[EMAIL PROTECTED]]
 Sent: Sunday, December 30, 2001 5:37 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] odbc date


 for Win32(NT) and MSAcess 2000, whenever you retrieve a date column/field,
 php will automatically convert it to '/mm/dd hh:mm:ss' format
 regardless
 of the style of date you've denoted in Access

 how can I resolve this problem and print in a different format?
 --


 Best regards,
 George Nicolae
 IT Manager
 ___
 X-Playin - Professional Web Design
 www.x-playin.f2s.com






 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] odbc date

2001-12-31 Thread George Nicolae

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
'-MM-DD' }



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] odbc date

2001-12-31 Thread Andrew Hill

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_formatbr;
}

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:[EMAIL PROTECTED]]
 Sent: Monday, December 31, 2001 12:51 PM
 To: [EMAIL PROTECTED]
 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
 '-MM-DD' }



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] odbc date

2001-12-31 Thread George Nicolae

it is right but I want to select all data from a mdbdatabase table and I
receive in '/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 [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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_formatbr;
 }

 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:[EMAIL PROTECTED]]
  Sent: Monday, December 31, 2001 12:51 PM
  To: [EMAIL PROTECTED]
  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
  '-MM-DD' }
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] odbc date

2001-12-31 Thread Andrew Hill

George,

Yes, using the date() example.

Cheers,
Andrew


 -Original Message-
 From: George Nicolae [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 31, 2001 1:26 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] odbc date


 it is right but I want to select all data from a mdbdatabase table and I
 receive in '/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 [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  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_formatbr;
  }
 
  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:[EMAIL PROTECTED]]
   Sent: Monday, December 31, 2001 12:51 PM
   To: [EMAIL PROTECTED]
   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
   '-MM-DD' }
  
  
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
  
  
  
 
 



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] odbc date

2001-12-31 Thread George Nicolae

date() use a timestamp. I receive a string. if I echo
odbc_result($cursor,date) it shows like 2001-11-21 00:00. Can it echo
(without date() function because I don't receive a timestamp) 21 Nov 2001?

--


Best regards,
George Nicolae
IT Manager
___
X-Playin - Professional Web Design
www.x-playin.f2s.com



Andrew Hill [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 George,

 Yes, using the date() example.

 Cheers,
 Andrew


  -Original Message-
  From: George Nicolae [mailto:[EMAIL PROTECTED]]
  Sent: Monday, December 31, 2001 1:26 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] odbc date
 
 
  it is right but I want to select all data from a mdbdatabase table and I
  receive in '/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 [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   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_formatbr;
   }
  
   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:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 12:51 PM
To: [EMAIL PROTECTED]
    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
'-MM-DD' }
   
   
   
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
   
   
   
  
  
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] odbc date

2001-12-30 Thread Bogdan Stancescu

If everything else fails, you can retrieve unix_timestamp(date) and use PHP's
date() to format the output.

HTH

Bogdan

George Nicolae wrote:

 for Win32(NT) and MSAcess 2000, whenever you retrieve a date column/field,
 php will automatically convert it to '/mm/dd hh:mm:ss' format regardless
 of the style of date you've denoted in Access

 how can I resolve this problem and print in a different format?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]