Does PHP not have the ability to format datetime values in a specific format? This is likely to do with local regional settings on the operating system rather than anything else, but you can always request a specific format from SQL Server instead of relying on PHP or the O/S to format them the same way by coincidence.
SELECT CONVERT(CHAR(10), col, 120) + ' ' + CONVERT(CHAR(8), col, 108)
FROM dbo.table;
That said, PHP is probably the best place to do this, but I have to apologize - I'm not versed in PHP well enough to tell you how to do that (in C#, for example, you'd use .Format()
).
From here:
http://php.net/manual/en/datetime.format.php
Looks like instead of just dumping the string to the screen you should be using
echo date_format($date_var_from_rs, 'Y-m-d H:i:s');
As for the default formats on your Ubuntu servers, this blog post might be useful as well:
http://ccollins.wordpress.com/2009/01/06/how-to-change-date-formats-on-ubuntu/