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

2020 is a leapyear #86

Closed
mgradwohl opened this issue Aug 20, 2019 · 5 comments
Closed

2020 is a leapyear #86

mgradwohl opened this issue Aug 20, 2019 · 5 comments
Labels
feature-request New feature or request

Comments

@mgradwohl
Copy link
Member

2020 is a leap year and there are lot of times developers do things like manipulate SYSTEMTIME or FILETIME or convert from one to another, and they do not take into account leap years. C# has AddYears() for this.

WIL should implement safe date manipulation methods like C# so that 2020 isn't a mess.

@sylveon
Copy link
Contributor

sylveon commented Aug 20, 2019 via email

@dunhor dunhor added the feature-request New feature or request label Aug 20, 2019
@mgradwohl
Copy link
Member Author

SystemTimeToFileTime and the reverse for conversion actually causes problems, this is exactly why .net has AddYears().

@jonwis
Copy link
Member

jonwis commented Apr 21, 2021

@ShawnSteele - are there Windows platform APIs to manipulating times like the .NET versions?

This - standard APIs for manipulating times - might be a good fit for http://github.com/microsoft/projectreunion

@sylveon
Copy link
Contributor

sylveon commented May 25, 2021

And 2 years later we have C++20's std::chrono dates which correctly handles leap years and leap seconds. I'm not sure date manipulation APIs are a good fit for Project Reunion, this topic should be best left to the language implementation/standard library.

@jonwis
Copy link
Member

jonwis commented Jul 5, 2022

I'm going to close this for now since we support std::chrono everywhere it needs to be.

WinAppSDK might still be a reasonable place to put language-agnostic date manipulation methods based on the WinRT DateTime & TimeSpan structs, but most language runtimes have a preferred version they already provide.

@jonwis jonwis closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants