1

Unexpected side effects when parsing dates in Android

view story
linux-howto

http://stackoverflow.com – In various Android projects, I use the following static function to parse dates such as 1900-12-31. Of course, this function should be deterministic - but it turns out it is not. Why? Normally, it parses the date 2010-10-30, for example, to the correct Date instance holding that value. But I have noticed that when I have an IntentService running at the same time and parsing some dates, this function parses the same date as above to 1983-01-20, which is one of the dates parsed in the IntentService. How can this happen? public static Date dateFromString(String dateStr) { SimpleDateFormat m (HowTos)