MSSQL Date Format Problem
| From: | Calum Scott | Date: | Sat, 14 Sep 2002 14:17:28 +0000 |
| Subject: | MSSQL Date Format Problem | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-15810@lists.php.net to get a copy of this message | ||
Hi,
I have a small problem with the formats of dates on two separate machines
running the same code!
Machine One
-----------
Windows 2000 Pro
IIS 5
PHP 4.1.2
MS SQL Server 7
Machine Two
-----------
Windows 2000 Advanced Server
IIS 5
PHP 4.1.2
MS SQL Server 2000
Code
----
<?
$cn = mssql_connect("SRVName","User","Password");
mssql_select_db("DBName");
$sqlq = "select DateField from Table";
$rs = mssql_query($sqlq);
$row = mssql_fetch_row($rs);
echo $row[0];
?>
Results Machine One
-------------------
14 Sep 2002 0:00
Results Machine Two
-------------------
Sep 14 2002 12:00AM
I have tried setting all the "Regional Settings" locales and languages to
British English on both machines but it seems like I've missed one on
Machine Two!
Incidentally, inserting a value into the databases on both machines works
presenting the date as "14/9/2002", it is just when returning a recordset to
PHP via the select statement that the difference occurs.
I'm at a total loss! It must be something to do with PHP, IIS or SQL Server
but I can't find what, if anyone has any ideas I'd be most grateful, however
recoding is not an option as the system is pretty big!
TIA
CAS