Afficher un message
Vieux 19/02/2008, 12h13   #4
Alessandro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Different MSSQL output date format from the same PHP script

On 19 Feb, 10:55, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
> Alessandro wrote:
> > I have a Windows Server 2003 R2 SP2 box where MS SQL 2000 SP4 is
> > running.

>
> Using MSSQL, you are really best off specifying your desired date format
> as part of the query itself. e.g.
>
> SELECT CONVERT(varchar(20),my_date,20) AS my_date
> FROM my_table


I agree with you approach. Unfortunately I have many queries of this
kind:

SELECT * FROM my_table

and I display datetime columns with instructions like the following:
echo "DATE1: ".date("d/m/Y",strtotime($row[DateTimeColumn1]));

I have to parse all my scripts (too many) and change both the query
and the echo argument...
  Réponse avec citation
 
Page generated in 0,05472 seconds with 9 queries