|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65738 Column metadata for datetimeoffset is incorrect
Submitted: 2013-09-23 02:53 UTC Modified: 2016-10-31 17:37 UTC
From: Assigned:
Status: Not a bug Package: PDO DBlib
PHP Version: 5.5.4 OS: Debian 7.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2013-09-23 02:53 UTC]
When using getColumnMeta() on pdo_dblib, on a column of type 
'datetimeoffset(0)', the returned structure looks like this:

array(10) {
  ["max_length"] => int(104)
  ["precision"] => int(0)
  ["scale"] => int(0)
  ["column_source"] => string(7) "updated"
  ["native_type"] => string(4) "char"
  ["native_type_id"] => int(47)
  ["native_usertype_id"] => int(0)
  ["name"] => string(7) "updated"
  ["len"] => int(104)
  ["pdo_type"] => int(2)

Note that it believes that the native_type is char, when it should be 

Expected result:
I expect to see 'datetimeoffset' as the native_type.

Actual result:
You get 'char' - which is incorrect.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-23 02:56 UTC]
Actually, unfortunately on a real char field, it also returns "char" and also type 
47 :(  So I'm not sure how to distinguish these.
 [2016-10-15 23:17 UTC]
-Package: MSSQL related +Package: PDO DBlib
 [2016-10-31 17:37 UTC]
-Status: Open +Status: Not a bug
 [2016-10-31 17:37 UTC]
I'm guessing you saw this because of the TDS version you used. This column type was introduced in SQL Server 2008, so you have use TDS >=7.3. You can choose the TDS version with a "version" param in the DSN.

Some general compatibility notes: Compatibility for Down-level Clients
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Dec 03 20:05:54 2022 UTC