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

Fix (#96) improve datetime parsing on sql server #103

Conversation

followynne
Copy link
Member

@followynne followynne commented Jan 7, 2024

This PR aims to fix #96, by changing the default datetime parsing in MS SQL Provider.

The default parse will assume that the date saved in the database is related to the application culture, assuming it's local based.

If the user isn't satisfied by the default parsing, a new parameter can be used to customize the datetime parsing. The DateTime produced must be UTC-kind or the app will throw an exception.

EDIT: it also bumps npm libraries (will close the other PRs later)

@followynne
Copy link
Member Author

Hello @mo-esmp,

I tried a fix for #96 + added Teronis package to package the nuget with the referenced dll (I didn't find a way to dotnet pack and include the reference to serilog.ui.core...)

If you like both changes, I'd move onwards and publish an alpha version for mssql provider, to let users test it (and test nuget publication from my side) 😄

@followynne followynne marked this pull request as ready for review January 7, 2024 21:19
@mo-esmp
Copy link
Member

mo-esmp commented Jan 10, 2024

Sorry for the late response. Do we need to add some tests regarding the bug? because for me it is still unclear under what circumstances this bug can happen.

@followynne
Copy link
Member Author

@mo-esmp

tests added, let me know if the bug and its fix are more clear 😄

@mo-esmp
Copy link
Member

mo-esmp commented Jan 13, 2024

Thanks for adding tests.

@followynne followynne merged commit edbc144 into serilog-contrib:master Jan 14, 2024
4 checks passed
@followynne followynne deleted the fix/96-improve-datetime-parsing-on-sql-server branch January 14, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timestamp returned as Jan 1, 1901 0:00:00.000
2 participants