I have some code which records a DateTime in some output files:
DateTime dateTime = DateTime::Now;
String^ value = String::Format("{0} {1}", dateTime.ToShortDateString(), dateTime.ToLongTimeString());
...which is apparently giving some odd outputs on a customers machine:
2014-12-16 오전 12:00:00
What might be causing those additional characters to appear there?
That's fairly reasonable if the user is in a different locale - you should ask your customer what their system locale is. Use the invariant culture if you want a machine-readable format. For example:
String^ value = dateTime.ToString("yyyy-MM-dd HH:mm:ss",
CultureInfo::InvariantCulture);
Those characters mean "forenoon" in Korean according to Wikipedia (see English link), so I guess it's in the client's regional settings, which are represented through (presumably) ToLongTimeString().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With