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);
See more on this question at Stackoverflow