Why does this keep returning 0?
Calendar calendar = Calendar.getInstance();
calendar.get(Calendar.HOUR_OF_DAY)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Calendar.HOUR_OF_DAYwill be 0 whenever the hour of the day falls between between midnight and one o’clock in the morning. So chances are, either it is in that time interval wherever you are, or your Android emulator is set up so it thinks you’re in that time interval.If that’s not the case, you could try setting the hour to some arbitrary value and then getting it again to check that it’s working. To do that, try: