Bug #121442 DATETIME data type fields exposed as MySqlDateTime through the ADO.NET driver are not IFormattable

Submitted: 7 Oct 0:25 Modified: 9 Oct 21:06
Reporter: Vi Uv Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Jose Ramirez Ruiz CPU Architecture:Any

[7 Oct 0:25] Vi Uv
Description:
The MySqlDateTime data type is used in MySQL ADO.NET client driver. This data type does not support IFormattable interface; therefore, it cannot be formatted in GUI controls by applying standard .NET formatting classes/methods. Either those DB data types that can be represented as DateTime or DateTimeOffset should be exposed as such, or IFormattable should be implemented by MySqlDateTime.

How to repeat:
Create table1 with a DATETIME column1. Populate with current date.
Create a .NET project and install MySQL client Nuget package.
Create a connection to the database and a command with "select column1 from table1".
Bind a DataGridView to the result.
Apply formatting to the colun. The format string will be ignored, and the data will be showing in the default format.

Suggested fix:
Either replace MySqlDateTime with DateTime and DateTimeOffset or implement IFormattable.
[9 Oct 21:06] Jose Ramirez Ruiz
Verified.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.