❔ DateTime culture info persistense

Hi! Say we have a DateTime variable called MyVariable. When I want to convert it into a string, I want to use a specific culture info. Usually, you just do MyVariable.ToString(MyCulture). But is there a way for me to set the culture info before the conversion? MyVariable.CultureInfo = MyCulture and then somewhere later MyString = MyVariable.ToString()
3 Replies
Thinker
Thinker2y ago
nope By default DateTime.ToString() uses the current culture, and I don't think you can change that. DateTime represents time agnostic of culture, so it wouldn't make sense to be able to set its culture
christoffer_tornell
Ok, makes sense I guess. Thanks 🙂
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server