Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7385
| From | ndrs <andreas.kohlmajer@gmx.de> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | SQLDateTime (Package DatabaseLink) with $TimeZone |
| Date | 2011-12-21 11:58 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jcshlp$2aj$1@smc.vnet.net> (permalink) |
Hello!
Is there a simple solution to use $TimeZone together with SQLDateTime
to write to the SQL data type datetimeoffset?
Example: SQL (MS SQL 2008) database [TestDB] with a table [TestData],
having only one column [Timestamp1] declared as datetimeoffset(2).
This stores a timestamp, together with the time zone information and a
precision of max. 2 decimals of a second, e.g. SELECT
CONVERT(DATETIMEOFFSET(2),SYSDATETIMEOFFSET()) gives "2011-12-20
09:40:16.42 +01:00" (current time in Germany).
Reading this column via package DatabaseLink gives SQLDateTime[{2011,
12, 20, 9, 40, 16.42}]. If I write SQLDateTime[{2011, 12, 20, 9, 40,
16.42}] back to the database, I get "2011-12-20 09:40:16.42 +00:00",
so the time zone information is lost - more precisely: it has not been
transmitted, I think. Is there a way to use $TimeZone, that the result
would be "2011-12-20 09:40:16.42 +01:00"?
Thanks for your help!
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
SQLDateTime (Package DatabaseLink) with $TimeZone ndrs <andreas.kohlmajer@gmx.de> - 2011-12-21 11:58 +0000
csiph-web