On 25 Mar, 10:28, yashiro <noum...@yahoo.frwrote:
Quote:
Hello
i Have a database in SQLserver.
I am using php to connect to it and to retrieve data from that
database.
I have a table with a column (DATATIME)
>
where i do :
$result = mssql_query("SELECT date FROM table1") or
die(mssql_error());
>
while ($row=mssql_fetch_array($result,MSSQL_NUM)){
echo $row[1];
>
}
>
i got the data like :
>
17/mars/2008 10:54
18/mars/2008 15:34
>
why the default date format is : DD/MON/YYYY HH:ii:ss
where can i change de that default format?
or how can i change that format?
>
i have tried :
echo ;date("d.m.y HH:i", strtotime($row[1]))
>
it showed me 01.01.70
>
thanks
I doubt if the column is DATATIME, it is more likely DATETIME.
Could you export the table schema and post it?
According to the manual for MySQL 5.0, the system variables to change
the default datetime output format is not yet implemented so I'm very
surprised to see an output like this from a DATETIME field.
You should use the MySQL function DATE_FORMAT() to output the field
value as you want it.