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;
    }/* w w  w  . j  ava  2 s  .  c  om*/
}

Related Tutorials