Here you can find the source of setTime(final Calendar calendat, final String[] test)
private static Calendar setTime(final Calendar calendat, final String[] test)
//package com.java2s; import java.util.Calendar; public class Main { private static Calendar setTime(final Calendar calendat, final String[] test) { if (test.length == 3) { calendat.set(Calendar.HOUR_OF_DAY, Integer.parseInt(test[0].trim())); calendat.set(Calendar.MINUTE, Integer.parseInt(test[1].trim())); calendat.set(Calendar.SECOND, Integer.parseInt(test[2].trim())); }//from w w w.j a va 2 s .c o m if (test.length == 2) { calendat.set(Calendar.HOUR_OF_DAY, Integer.parseInt(test[0].trim())); calendat.set(Calendar.MINUTE, Integer.parseInt(test[1].trim())); calendat.set(Calendar.SECOND, 0); } return calendat; } }