Culture Specific custom date formatting. #1561
Replies: 5 comments
-
Instead of |
Beta Was this translation helpful? Give feedback.
-
But what about the custom format? Currently hard coded as Format("MM-dd-yy") because that is how it is received so far and still receiving that. |
Beta Was this translation helpful? Give feedback.
-
It is possible that I found the solution. Here is the custom converter I was able to write.
|
Beta Was this translation helpful? Give feedback.
-
You can specify multiple formats. [Format("MM-dd-yy", "dd/MM/yy")] |
Beta Was this translation helpful? Give feedback.
-
Right, I know I can but in that case I cannot understand if 05/08/20 is August or May, that is why I needed culture. |
Beta Was this translation helpful? Give feedback.
-
Currently I have DTO as the following, which worked pretty fine until now.
But now, I started to receive another data that does not fit this. They send dd/MM/yy for en-CA. So by default, that is really no the formatting and so far I used the following:
new CsvConfiguration(CultureInfo.InvariantCulture)
How can I make reader work based on the custom format being sent.
I am willing to make a typeconverter to handle it but seems like I cannot access the culture set in the configuration.
Can you please guide?
Beta Was this translation helpful? Give feedback.
All reactions