我是靠谱客的博主 畅快小馒头,这篇文章主要介绍java随机时间早上8点到晚上10点_【JAVA】判断当前日期是否在时间点内,现在分享给大家,希望可以做个参考。

public static boolean isInDate(Date date, String strDateBegin,

String strDateEnd) {

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

String strDate = sdf.format(date);

// 截取当前时间时分秒

int strDateH = Integer.parseInt(strDate.substring(11, 13));

int strDateM = Integer.parseInt(strDate.substring(14, 16));

int strDateS = Integer.parseInt(strDate.substring(17, 19));

// 截取开始时间时分秒

int strDateBeginH = Integer.parseInt(strDateBegin.substring(0, 2));

int strDateBeginM = Integer.parseInt(strDateBegin.substring(3, 5));

int strDateBeginS = Integer.parseInt(strDateBegin.substring(6, 8));

// 截取结束时间时分秒

int strDateEndH = Integer.parseInt(strDateEnd.substring(0, 2));

int strDateEndM = Integer.parseInt(strDateEnd.substring(3, 5));

int strDateEndS = Integer.parseI

最后

以上就是畅快小馒头最近收集整理的关于java随机时间早上8点到晚上10点_【JAVA】判断当前日期是否在时间点内的全部内容,更多相关java随机时间早上8点到晚上10点_【JAVA】判断当前日期是否在时间点内内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(117)

评论列表共有 0 条评论

立即
投稿
返回
顶部