Date is showing hour of 1, when it should be 0 Calendar cal = Calendar.getInstance(); cal.set(Calendar.MONTH, 1); cal.set(Calendar.HOUR_OF_DAY, 00); cal.set(Calendar.MINUTE, 1); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); System.out.println(cal.getTime()); System.out.println(cal);
outputs: Sun Feb 19 00:01:00 PST 2017 java.util.GregorianCalendar[time=1487491260000,areFieldsSet=true,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2017,MONTH=1,WEEK_OF_YEAR=8,WEEK_OF_MONTH=4,DAY_OF_MONTH=19,DAY_OF_YEAR=50,DAY_OF_WEEK=1,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=1,SECOND=0,MILLISECOND=0,ZONE_OFFSET=-28800000,DST_OFFSET=0] It should be 00:00:01 -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/codenameone-discussions. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/78746226-7d88-4350-ab68-70729c68ef42%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
