EPUB | CHM | PDF

FAQ - Question #7

Top Previous Next

Q. If I set DateStyle option by myself, I get error during Posting data to server.

A. Dates values are coming from the server in a textual form, but Delphi TDateField class expects binary TDateTime (double) representation. So PostgresDAC must encode/decode date values internally.

So to be independent of server datestyle settings PostgresDAC silently executes such query at the start of each session:

SET DateStyle TO 'ISO, MDY'

When you change DateStyle settings date output is changed and internal PostgresDAC routines are confused about it.

If you need to change date representation in your application use TDateTimeField.DisplayFormat property for this purpose.

See also: Questions list, Datestyle tips and tricks