Re: MS-SQL date format problem
| From: | Robert Twitty | Date: | Mon, 12 May 2003 14:34:25 +0000 |
| Subject: | Re: MS-SQL date format problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27663@lists.php.net to get a copy of this message | ||
The default character format chosen for datetime fields is determined by
the underlying driver. For ODBC its "2003-06-01 13:05:11.234" and for
DB-Library and FreeTDS it's "Jun 1 2003 1:05PM". If you set the ini option
mssql.datetimeconvert to 0, then it will be "2003-06-01 13:05:11". On
FreeTDS it may also be influenced by the locale setting. It does
not matter whether you use mssql_fetch_array or mssql_fetch_row. If you
want to be certain that your datetime data will always appear a certain
way then use CONVERT, instead of relying on the driver.
-- bob
On 12 May 2003, Adam Voigt wrote:
> Hmm, what fieldtype is it in the DB?
> We have a bunch of DATETIME type's, and using
> a standard query it works just fine, returning
> in the proper format, without ODBC.
>
> The only difference is we use mssql_fetch_array
> instead of fetch_row.
>
> On Mon, 2003-05-12 at 09:12, Peter Misun wrote:
> > Does anybody know, how to set date-time format for mssql_* functions?
> >
> > For example, after retrieving data by function mssql_fetch_row, the value returned was
> > "22 XII 1975 0:00
> > " (which is midnight of 22nd December 1975)
> > As you see, value "XII" (for month) is really unusable
> >
> > where to set that date format?
> >
> > with odbc functions it returns "1975-12-22 00:00:00.000", wha is really clear
> >
> > 5o
> --
> Adam Voigt (adam@cryptocomm.com)
> Linux/Unix Network Administrator
> The Cryptocomm Group
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>