-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date/Date32/DateTime/DateTime64 min value read as 0001-01-01 #60
Comments
Actually, same issue for |
DateTime affected too. Not tested DateTime64 yet, but probably also affected. |
DateTime64 also returns |
I don't get
CREATE TABLE IF NOT EXISTS TypeTable
(
Id Int32,
Column DateTime64
)
ENGINE = Memory();
INSERT INTO TypeTable (Id, Column) VALUES (1, toDateTime64('1925-01-01', 3)); Fetching code: public class TypeTable
{
int Id { get; set; }
DateTimeOffset Column { get; set; }
}
var result = await _connection.QueryFirstOrDefaultAsync<TypeTable>("SELECT * FROM TypeTable"); |
Also there is a problem with filtering by DateTime64 values: var result = await _connection.QueryFirstOrDefaultAsync<TypeTable>(
new CommandDefinition(
"SELECT * FROM TypeTable WHERE Column > {DateTimeFilter:DateTime64}",
new Dictionary<string, object>
{
{ "DateTimeFilter", new DateTimeOffset(1930, 1, 1, 1, 1, 1, TimeSpan.Zero) }
}
)
); Exception:
|
Data reader's
GetValue
/GetDate
method returns default value0001-01-01
instead of actual value from table.Works fine for max-value (
2283-11-11
) or1925-01-02
.The text was updated successfully, but these errors were encountered: