Skip to content

Commit 2d9875d

Browse files
Bill Evansjimhester
Bill Evans
authored andcommitted
fix string format of unsupported MSSQL datetimeoffset (-155)
- fix format of returned object of type `DATETIMEOFFSET` (-155) from `"2018-09-12 22:38:56 Pacific Standard Time"` to `"2018-09-13 05:41:20.4607764 +00:00"` - closes #207, "datetimeoffset unsupported" (in modern SQL Server ODBC drivers)
1 parent f22944e commit 2d9875d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

NEWS.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# odbc 1.1.6.9000
2+
3+
- fix SQL Server ODBC's unsupported '-155' data type, and its losing
4+
sub-second precision on timestamps; this still returns type
5+
`DATETIMEOFFSET` as a character, but it preserves sub-seconds and
6+
has a numeric timezone offset (#207, @r2evans)
7+
18
# odbc 1.1.6
29

310
## Features

src/nanodbc/nanodbc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2623,7 +2623,6 @@ class result::result_impl
26232623
break;
26242624
case SQL_TIMESTAMP:
26252625
case SQL_TYPE_TIMESTAMP:
2626-
case SQL_SS_TIMESTAMPOFFSET:
26272626
col.ctype_ = SQL_C_TIMESTAMP;
26282627
col.clen_ = sizeof(timestamp);
26292628
break;
@@ -2640,6 +2639,7 @@ class result::result_impl
26402639
break;
26412640
case SQL_WCHAR:
26422641
case SQL_WVARCHAR:
2642+
case SQL_SS_TIMESTAMPOFFSET:
26432643
col.ctype_ = SQL_C_WCHAR;
26442644
col.clen_ = (col.sqlsize_ + 1) * sizeof(SQLWCHAR);
26452645
if (is_blob)

0 commit comments

Comments
 (0)