is Night Time by hour - Android java.util

Android examples for java.util:Date Time

Description

is Night Time by hour

Demo Code


//package com.java2s;

public class Main {
    public static boolean isNightTime(int hour) {
        //Tells us if it's day or night!
        //Used for updating the background colour.
        boolean isNight;

        isNight = hour < 6 || hour > 18;
        return isNight;
    }//from w  ww .j  a  va 2  s . com
}

Related Tutorials