-
Notifications
You must be signed in to change notification settings - Fork 27
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
How is CultureInfo respected when formatting dates? #36
Comments
Hi, CultureInfo is used by the formatter to get month names, era names, date separator, decimal separator and number group separator. Admittedly not extensively covered by tests, but at least there's one for date separators in different cultures:
|
If my goal is to simply use the date separators and what-have-you that's defined in the format we pass to |
Hi @kikaragyozov, Keep in mind that Excel formats data differently depending on the language settings of your operating system. F.ex if somebody creates a spreadsheet in the US with dates, thousands etc, it would look differently on my machine here in Europe. The easiest is to just pass |
I fail to grasp how
NumberFormat.Format(DateTime, CultureInfo)
respects the provided CultureInfo object in any way or fashion. It seems to always manage to convert the date in any providedCultureInfo
, even if that format does not exist for it.That begs the question - is there an example you can provide where something unexpected is produced, or an exception of some kind is thrown due to differences in the
CultureInfo
object?Perhaps the same issue persists in
NumberFormat.Format(string, CultureInfo)
but I think I'm wrong on this.The text was updated successfully, but these errors were encountered: