Date format in PHP coming from SQL server

1

I'm running the following code:

$sql= mssql_query("select getdate()");
$res = mssql_fetch_assoc($sql);

and it is returning me the following date:

  

2015-04-10 32767: 06

The time is 5 digits, does anyone know why?

ps. I've already changed the directive from php.ini to: mssql.datetimeconvert = Off

    
asked by anonymous 02.10.2015 / 14:56

1 answer

2

Change your query to the code below:

SELECT CONVERT(VARCHAR(19), GETDATE(), 120) AS DATA

As a result you will have something like:

2015-10-02 13:45:05
    
02.10.2015 / 18:49