I have a text file with DateTimes stored like this: 30/11/2013 1:18:36 PM
This is fine if you only run the program on one machine, as the DateTime is stored in the same format as the system uses. However I just encountered a problem where if I change user to one of my other accounts, who for some reason is using MM/DD/YYYY format, an error is thrown. How can I read the DateTime regardless of what the system format is? This is what I'm using right now:
RecieptList.Add(new Reciept
{
...
DateNTime = Convert.ToDateTime(stringArray[(i * 12) + 9]), // == 30/11/2013 1:18:36 PM
...
});
Thanks!