Skip to content Skip to sidebar Skip to footer

How To Set The Calendar In Android For Particular Hour

I dont want to add the year or month.Just the hour , minutes and seconds for each day. How to use it the Calendar object to do it ? This is my code // get a Calendar object with cu

Solution 1:

try using

calendar.set(Calendar.HOUR_OF_DAY, 4);
calendar.set(Calendar.MINUTE, 40);
calendar.set(Calendar.SECOND, 0);

Solution 2:

try this too

cal.set(2013,2,7,15,42,30);

Note: Months value is MonthNumber-1 (Jan is 0, Feb is 1 and so on).

Post a Comment for "How To Set The Calendar In Android For Particular Hour"