0

I have a user with a locale-specific issue. The issue is based on DateTime.parse which obviously can be handled from our end but my confusion is based on the fact that it was working for around 6 weeks just fine and only now they have the issue.

This user is adement they have never changed the language on the phone puzzles me as to how this could happen.

I tried Google and couldn't find any hints of how the locale could have randomly changed (assuming the user has never changed it, nor left their phone in the hands of someone who might).

Anyone know of anything?

EDIT:

Example:

One week ago:

DoSomething(DateTime.Parse("09/24/2014 15:21:00"); // Succeeds one week ago

Now one week later it fails using the same code.

DoSomething(DateTime.Parse("09/24/2014 15:21:00")); // Fails now, same device

My assumption is that System.Globalization.CultureInfo.CurrentCulture has changed somehow yet the user has not (knowingly) changed the language setting on the phone so how else can this change?

Le-roy Staines
  • 2,037
  • 2
  • 22
  • 40
  • Post some related code. – Aniruddha Sep 30 '14 at 04:00
  • @Aniruddha I don't think this question is code-specific? Basically I am storing a DateTime.ToString() value and then later parsing it back using DateTime.Parse(). This worked for so many weeks on this one device and now fails due to incorrect locale specification which indicates the locale changed between the DateTime.ToString and the DateTime.Parse. I understand that but what I want to know is if there is some weird Android situation where this can happen without the user actually choosing a new locale i.e. switching English(New Zealand) to English(United States) – Le-roy Staines Sep 30 '14 at 04:08
  • You must be using `SimpleDateFormat` in your code. So are you passing Locale in constructor? – Aniruddha Sep 30 '14 at 04:10
  • FYI, Xamarin.Android has bug with daylight savings that has only surfaced in the past week. This could be related to your issues. See https://bugzilla.xamarin.com/show_bug.cgi?id=4227 and http://forums.xamarin.com/discussion/25093/dst-daylightsavingtime-issue-for-datetime-now – matthewrdev Oct 01 '14 at 04:31
  • Hmm; that's a little disconcerting. Not the first time they've had a bug with daylight savings either. – Le-roy Staines Oct 03 '14 at 04:45

0 Answers0