android - Java Calendar behave differently -


in following snippet of code, try date of first day of current week, in week system starts saturday:

calendar cal = calendar.getinstance(); cal.setfirstdayofweek(calendar.saturday); cal.set(calendar.day_of_week,cal.getfirstdayofweek()); 

when run code here, computed date correctly previous saturday (today tuesday way), when use code in android program, date set next saturday! idea why?

try calendar timezone or locale arguments. way should able make sure there isn't different value different locales / timezone.

like this:

calendar.getinstance(locale.canada); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -