Page 1 of 1

Saving date with time zone

Posted: Thu 02 Apr 2015 18:28
by smelchi
Hi using Delphi XE, UNIDAC 6.01, SQL SERVER 2008 how can I save and retrieve datetime with time zone in datetimeoffset field?

Thanks

Re: Saving date with time zone

Posted: Fri 03 Apr 2015 11:45
by azyk
You can work with the datetimeoffset data type as with a string value in the following format:

Code: Select all

YYYY-MM-DD hh:mm:ss[.nnnnnnn] [+|-]hh:mm
For this, set the 'OLEDBProvider' option to 'prSQL' in the connection settings. For example:

Code: Select all

UniConnection.SpecificOptions.Values['OLEDBProvider'] := 'prSQL';