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

Missing microsecond accessors #1121

Closed
roji opened this issue May 14, 2018 · 4 comments
Closed

Missing microsecond accessors #1121

roji opened this issue May 14, 2018 · 4 comments

Comments

@roji
Copy link

roji commented May 14, 2018

It would seem that NodaTime types in general are missing microsecond accessors and methods. LocalDateTime is a good example: there are Millisecond and NanosecondOfDay properties but no Microsecond. Same thing goes for PlusMilliseconds() and PlusNanoseconds(), but no PlusMicroseconds().

I'm working on support for PostgreSQL, which represents timestamps at an accuracy of 1 microsecond so it's somewhat annoying, but I'm asking mostly out of curiosity.

@jskeet
Copy link
Member

jskeet commented May 14, 2018

Yes, we somewhat-deliberately didn't add these - we weren't sure there'd be enough call for them. I don't massively object to doing so, but I'd probably like to wait to see if there's more call for them to start with.

For the moment, I'd suggest adding extension methods so you can keep all the conversions in one place. Let me know if there are any places where this turns out to be hard to do outside the library.

@roji
Copy link
Author

roji commented May 14, 2018

Well, it's always possible to specify microseconds via nanoseconds so this isn't a blocker - more an issue of completeness. And unfortunately C# doesn't have extension properties.

Will leave this open for you to consider but feel free to close.

@jskeet
Copy link
Member

jskeet commented May 14, 2018

I'm happy to leave it open to see if it attracts more attention. I might even write a prototype PR at some point, just so we can see how many more members it introduces. (I'm somewhat concerned that the API surface of Noda Time is already pretty huge.)

@jskeet jskeet added this to the unscheduled milestone May 14, 2018
@jskeet
Copy link
Member

jskeet commented Feb 1, 2020

Closing given that we haven't seen any more demand for this in more than 18 months.

@jskeet jskeet closed this as completed Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants