Hello,
I have a connection, where I set the DatetimeReadFormat property to yyyy.mm.dd hh:nn:ss. Displaying the information in a DBGrid works just fine.
However, when I copy the data with ClipBoard.AsText := Self.SelectedField.AsString; this format is omitted and resets to TZFormatSettings and results something like "2018/ 12/ 12/ 0:00:00".
So, the question is, shouldn't DatetimeReadFormat affect the format settings inside a TZConnection...?
If yes, an important note to add is that these properties are NOT set design-time but runtime, before calling .Connect.
Shouldn't the SQLConnection's DatetimeReadFormat affect TZFormatSettings...?
Shouldn't the SQLConnection's DatetimeReadFormat affect TZFormatSettings...?
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Shouldn't the SQLConnection's DatetimeReadFormat affect TZFormatSettings...?
Hello aehimself,
I am not sure, if I understand you correctly. DatetimeReadFormat is meant for situations where we read dates and time from the database as Strings. So it tells us how the database formats its DateTime values. It shouldn't do anything on TZFormatSettings because they are used for displaying dates and times to the user only - at least as far as I know. This is what the documentation has to day about this:
Best regards,
Jan
I am not sure, if I understand you correctly. DatetimeReadFormat is meant for situations where we read dates and time from the database as Strings. So it tells us how the database formats its DateTime values. It shouldn't do anything on TZFormatSettings because they are used for displaying dates and times to the user only - at least as far as I know. This is what the documentation has to day about this:
We don't use these params on PostgreSQL anymore because there we use binary representations now.Zeos 7.2 Release Notes wrote: The ReadFormat parameters decribe the date and time formats as the database sends them to the application.
[...]
These settings can be used to solve problems on the following drivers:
- dblib (FreeTDS, mssql, sybase)
- postgresql
- mysql (depending on parameter preferprepared, used if preferprepared is not set)
- ado (emulated parameters [...])
Best regards,
Jan
Re: Shouldn't the SQLConnection's DatetimeReadFormat affect TZFormatSettings...?
Ooooooooooh that makes sense.
So the answer is: absolutely NOT :)
Thanks for clearing this up so quickly!
So the answer is: absolutely NOT :)
Thanks for clearing this up so quickly!
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47