Android date/time displaying 0 instead of 12

前端 未结 2 567
隐瞒了意图╮
隐瞒了意图╮ 2021-01-07 14:43

I wonder what\'s wrong with my code below:

 // Assign hour set in the picker
        c.set( Calendar.HOUR, selectedHour );
        c.set( Calendar.MINUTE, se         


        
2条回答
  •  再見小時候
    2021-01-07 15:30

     hour = c.get( Calendar.HOUR );
     minute = c.get( Calendar.MINUTE );
     hour = c.get( Calendar.HOUR_OF_DAY );
    

    You are setting hour again after it was already set.

提交回复
热议问题