-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Add GetUtcNow to ITimeSystem #1701
Conversation
Or since Let's see what @lahma thinks is best. Either way implementation is trivial. |
I think the current implementation should suffice quite nicely. Maybe a test case would be a nice addition showcasing the new possibilities? |
The The real use cases for Jint are for the timestamp I guess https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider.gettimestamp?view=net-8.0#system-timeprovider-gettimestamp as we only need to subtract to get the different in milliseconds. |
No, it's been backported down to full framework. Will investigate why the doc says .NET 8 only. |
Oh, different assemblies, yes, probably. |
Yeah, might be nice to have the full TimeProvider available and could eventually be used to virtualize timers, timeouts and such as well as providing current time. I was just trying to keep this PR simple. |
Added a test showing how to integrate TimeProvider |
Jint is is using central package management so you need to add the new dependency to |
@lahma I'm confused by the build error saying it can't target .NET 8. I didn't change any framework version. This test project was already targeting |
It's OK, macos runners are lagging behind with net8.0 support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
Thank you! |
Fixes #1700