Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static boolean isSendNetWorkRequest() { boolean isSend = false; String hoursStr = new SimpleDateFormat("HH").format(new Date().getTime()); int hours = Integer.valueOf(hoursStr); if (hours > 8 && hours < 22) { isSend = true; } return isSend; } }