0

I am making an application in which user have to select weekend days and save it in the database. I want to save it in database in en-US but show it to user in his own culture:

1- I am retrieving all day names from:

CultureInfo.CurrentCulture.DateTimeFormat.DayNames  

How to convert day names selected by user to en-US day names?
How to convert en-US day names retrieved from database to user current culture day names?

Thank You,

  • Does this answer your question? [DateTime.Now.DayOfWeek.ToString() with CultureInfo](https://stackoverflow.com/questions/5716762/datetime-now-dayofweek-tostring-with-cultureinfo) – Sinatr Apr 15 '21 at 11:54
  • You will also need to [parse string to enum](https://stackoverflow.com/q/16100/1997232) to get [DayOfWeek](https://learn.microsoft.com/en-us/dotnet/api/system.dayofweek) value for string. – Sinatr Apr 15 '21 at 11:59
  • 1
    You would be better off storing day *numbers* (e.g. `DayOfWeek` values) and converting when you need to in the UI. – Matthew Watson Apr 15 '21 at 12:16

0 Answers0