I made a simple web service which worked nice with few systems that it was deployed. Now the date from Oracle causes trouble on other system.
Some info:
Our own methods that accesses oracle returns dates as string in format 15.09.2010 13:15:00 (note year in 4 digits)
System working: -DateTime.ToSring() produces 16.09.10 14:15:49 (used in log-file, note year in 2 digits) -TryParse(string s, out DateTime result); returns true with string 15.09.2010 13:15:00 -System.Globalization.CultureInfo.CurrentUICulture.Name has value "en-US" System NOT working: -DateTime.ToSring() produces 9/16/2010 1:25:51 PM (used in log file) -TryParse(string s, out DateTime result); returns false with string 15.09.2010 13:15:00 -System.Globalization.CultureInfo.CurrentUICulture.Name has value "en-US"
So my questions are:
- What is different with these 2 systems?
- What is the best way to make this code universal (i know i can use formatter for DateTime.TryParse and DateTime.ToString() )