Java tutorial
//package com.java2s; import java.util.Date; public class Main { /** * 06??-18?? ???? * * @return */ public static boolean isBaitian() { Date d = new Date(); int hours = d.getHours(); if (6 < hours && hours < 18) { return true; } else { return false; } } }