amaggiulli / QLNet

QLNet C# Library
https://amaggiulli.github.io/QLNet/
BSD 3-Clause "New" or "Revised" License
387 stars 174 forks source link

Add utility Date.ToDateTime() method #263

Closed igitur closed 3 years ago

igitur commented 3 years ago

QLNet

Thank you for contributing! Take a moment to review our contributing guidelines to make the process easy and effective for everyone involved.

You must open an issue before embarking on any significant pull request, especially those that add a new code or change existing tests, otherwise you risk spending a lot of time working on something that might not end up being merged into the project.

Before opening a pull request, please ensure:

Be kind to code reviewers, please try to keep pull requests as small and focused as possible :)

IMPORTANT: By submitting a patch via a Pull Request, you agree to allow the project owners to license your work under the terms of the BSD3 License.


Summary

Just a small PR: Adds Date.ToDateTime() to convert QLNet.Date back to good old System.DateTime. I know there is already an implicit operator, but sometimes having the date.ToDateTime() syntax is more fluent, espeically for continuation funtions, e.g. var days = d.ToDateTime().Subtract(DateTime.Today).TotalDays;