I need to write a method which returns true if a given date is between the hours of 8am and 5pm, and false otherwise. How would I implement this? Thanks a lot!
public static boolean isInWorkingHours(String date){
}
I need to write a method which returns true if a given date is between the hours of 8am and 5pm, and false otherwise. How would I implement this? Thanks a lot!
public static boolean isInWorkingHours(String date){
}
Parse the date parameter with the SimpleDateFormat, then set the resulting Date object as time property of a GregorianCalendar instance. Use calendar's get() method to retrieve the hour of day.
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html