Saving date with time zone

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
smelchi
Posts: 15
Joined: Fri 18 Jun 2010 16:37

Saving date with time zone

Post by smelchi » Thu 02 Apr 2015 18:28

Hi using Delphi XE, UNIDAC 6.01, SQL SERVER 2008 how can I save and retrieve datetime with time zone in datetimeoffset field?

Thanks

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Saving date with time zone

Post by azyk » Fri 03 Apr 2015 11:45

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';

Post Reply