Java Time Passed isInBetweenTimes(String startTime, String endTime)

Here you can find the source of isInBetweenTimes(String startTime, String endTime)

Description

is In Between Times

License

Apache License

Declaration

public static boolean isInBetweenTimes(String startTime, String endTime) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static boolean isInBetweenTimes(String startTime, String endTime) {
        Date nowTime = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
        String time = sdf.format(nowTime);
        if (time.compareTo(startTime) >= 0 && time.compareTo(endTime) <= 0) {
            return true;
        } else {//from  ww  w  .  j ava 2 s.c  om
            return false;
        }
    }
}

Related

  1. isConfilct(String begintimeOne, String endtimeOne, String begintimeTwo, String endtimeTwo)
  2. isExpire(String strTime, String strExpiredTime)
  3. isLimitTimeScope(String minTime, String maxTime)
  4. printTimeElapsed(long starttime)