Here you can find the source of isMorning(Calendar time)
Parameter | Description |
---|---|
time | the time |
public static boolean isMorning(Calendar time)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { /**//from w ww . j a v a 2s .c o m * Tests if a time is during the morning. * * @param time * the time * @return true if during the morning; otherwise false */ public static boolean isMorning(Calendar time) { if (time == null) { return false; } int hour = time.get(Calendar.HOUR_OF_DAY); return hour >= 6 && hour <= 10; } }