Skip to content
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

NpgsqlInterval different constructors different ToString #152

Closed
DavidKarlas opened this issue Jan 31, 2014 · 2 comments
Closed

NpgsqlInterval different constructors different ToString #152

DavidKarlas opened this issue Jan 31, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@DavidKarlas
Copy link
Contributor

var interval = new NpgsqlTypes.NpgsqlInterval(1, 2, 3, 4, 5);
var intervalFromTimespan = new NpgsqlTypes.NpgsqlInterval(new TimeSpan(1, 2, 3, 4, 5));
Console.WriteLine("Interval              :"+interval);
Console.WriteLine("Interval from timespan:" + intervalFromTimespan);

Output:

Interval              :1 day 02:03:04.005
Interval from timespan:26:03:04.005

First I thought that is 26 days :) then realized that it's just represented in hours... Can this be considered as bug?

@franciscojunior
Copy link
Member

This is definitely a bug! It should show the same output string.

I'll add the proper label on it.

Thanks for heads up, David!

glenebob added a commit that referenced this issue Feb 1, 2014
Call a more appropriate constructor from NpgsqlInterval(TimeSpan).
@ghost ghost assigned glenebob Feb 1, 2014
franciscojunior added a commit to franciscojunior/Npgsql that referenced this issue Feb 4, 2014
franciscojunior added a commit to franciscojunior/Npgsql that referenced this issue Apr 11, 2014
Change constructors to handle ticks with more than 30 days.
@franciscojunior franciscojunior added this to the 2.2 milestone Apr 11, 2014
franciscojunior added a commit that referenced this issue Jun 11, 2014
Fix bug #152: NpgsqlInterval different constructors different ToString
@franciscojunior
Copy link
Member

Fixed by #211. Closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants