MySqlDataReader.GetDateTime Method (String)

MySQL Connector/Net

MySqlDataReaderGetDateTime Method (String)
Gets the value of the specified column as a DateTime object.

Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data (in MySql.Data.dll) Version: 6.9.9
Syntax
public DateTime GetDateTime(
	string column
)
Public Function GetDateTime ( 
	column As String
) As DateTime
public:
DateTime GetDateTime(
	String^ column
)
member GetDateTime : 
        column : string -> DateTime 

Parameters

column
Type: SystemString
The column name.

Return Value

Type: DateTime
The value of the specified column.
Remarks

No conversions are performed; therefore, the data retrieved must already be a DateTime object.

Call IsDBNull to check for null values before calling this method.

Note Note

MySql allows date columns to contain the value '0000-00-00' and datetime columns to contain the value '0000-00-00 00:00:00'. The DateTime structure cannot contain or represent these values. To read a datetime value from a column that might contain zero values, use GetMySqlDateTime(Int32).

The behavior of reading a zero datetime column using this method is defined by the ZeroDateTimeBehavior connection string option. For more information on this option, please refer to ConnectionString.

See Also