Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

add ToString format paramater support for MySql DateTime #651

Merged
merged 2 commits into from
Jan 24, 2021
Merged

add ToString format paramater support for MySql DateTime #651

merged 2 commits into from
Jan 24, 2021

Conversation

pedoc
Copy link
Contributor

@pedoc pedoc commented Jan 24, 2021

currently, ToString on DateTime will ignore any format parameters and always convert to cast({quotedColName} as char(1000)),but most developers (at least in our opinion) want to convert according to the specified format and use it in Where or Select.

this commit achieves this goal by passing the ToString parameter as it is to the DateFormat function of Mysql.

@mythz
Copy link
Member

mythz commented Jan 24, 2021

Hi, thx for the PR! Can you also add a new test in ServiceStack.OrmLite.MySql.Tests with an example of what this PR allows, thx.

@pedoc
Copy link
Contributor Author

pedoc commented Jan 24, 2021

@mythz hi,i added some tests, please review,thx

@mythz mythz merged commit 638688e into ServiceStack:master Jan 24, 2021
@mythz
Copy link
Member

mythz commented Jan 24, 2021

Much Appreciated, thx!

This PR is now available from v5.10.5+ that's now available on MyGet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants