[
http://tracker.firebirdsql.org/browse/DNET-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jiri Cincura reopened DNET-654:
-------------------------------
> Trimming ten-thousandths of a second during TIMESPAN conversion to the
> DateTime in the NET Provider for Firebird.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DNET-654
> URL: http://tracker.firebirdsql.org/browse/DNET-654
> Project: .NET Data provider
> Issue Type: Bug
> Components: ADO.NET Provider
> Affects Versions: 4.7.0.0
> Environment: Windows 10, 64-bit
> Reporter: Kamil Kocian
> Assignee: Jiri Cincura
> Fix For: vNext
>
>
> The NET Provider for Firebird trims ten-thousandths of a second during
> TIMESPAN conversion to the .NET DateTime type in method
> TypeDecoder.DecodeTime(int sql_time). Trimming the ten-thousandths of a
> second is causing problem when comparing time read from Firebird to .NET and
> using the value again in SQL statements.
> However it is possible to initialize .NET type DateTime(or TimeSpan) with
> number of ticks, this way keeping the precision of Firebird TIMESTAMP in
> .NET.
> Problematic source code in
> FirebirdSql.Data.FirebirdClient\Common\TypeDecoder.cs :
> public static TimeSpan DecodeTime(int sql_time)
> {
> int millisInDay = sql_time / 10;
> int hour = millisInDay / 3600000;
> int minute = (millisInDay - hour * 3600000) / 60000;
> int second = (millisInDay - hour * 3600000 - minute * 60000) / 1000;
> int millisecond = millisInDay - hour * 3600000 - minute * 60000 -
> second * 1000;
> return new TimeSpan(0, hour, minute, second, millisecond);
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider