Re: DATE Format



On 25 Mar, 10:28, yashiro <noum...@xxxxxxxx> wrote:
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.
.



Relevant Pages

  • Re: DATE Format
    ... i Have a database in SQLserver. ... I am using php to connect to it and to retrieve data from that ... where can i change de that default format? ... surprised to see an output like this from a DATETIME field. ...
    (comp.lang.php)
  • Re: DATE Format
    ... i Have a database in SQLserver. ... I am using php to connect to it and to retrieve data from that ... where can i change de that default format? ... surprised to see an output like this from a DATETIME field. ...
    (comp.lang.php)
  • Re:Date Problem
    ... create table test(dt datetime) ... declare @dt varchar ... >database using asp.net. ... mm/dd/yyyy format. ...
    (microsoft.public.sqlserver.security)
  • RE: DateTime Parse and CultureInfo problem.
    ... any parsing when reading them from the database. ... The DateTime.ParseExact can only parse a string if the format is exactly as ... > String was not recognized as a valid DateTime. ...
    (microsoft.public.dotnet.framework)
  • RE: Time Zones
    ... You want to display the database datetime value in certain localization ... For #1, we may control this at UI side, with certain format string ... This posting is provided "as is" with no warranties and confers no rights. ...
    (microsoft.public.dotnet.framework.windowsforms)