You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have French interface language in my OS (along with English), as well as french regional formats.
When I run "Christmas" example, i get
Christmas: dimanche, 25 decembre 2022
Christmas is in month 12 of the year.
Christmas is day 359 of the year.
Christmas 2022 is on a Sunday.
Note that the first line shows weekday and month in French, while the last one - in English.
So default formatting is culture-specific, while the one with christmas.DayOfYear appears to be culture-invariant. But why does the program use different cultures without any intentional switching made by a programmer?
The text was updated successfully, but these errors were encountered:
I think you mean DayOfWeek. DayOfYear is a number between 1 and 366. DateTime.DayOfWeek returns an enum and they cannot be localized so they are in effect always culture-invariant. You would need to use a format code like the first example instead.
I have French interface language in my OS (along with English), as well as french regional formats.
When I run "Christmas" example, i get
Note that the first line shows weekday and month in French, while the last one - in English.
So default formatting is culture-specific, while the one with
christmas.DayOfYear
appears to be culture-invariant. But why does the program use different cultures without any intentional switching made by a programmer?The text was updated successfully, but these errors were encountered: