Hi All,
I'm trying to convert a time input by the user in the format HH:mm into an actual Time so I can compare it to the current time.
I thought that one way to do this might be to convert it to a date so tried the following:
But I get the error "The method parse(String) is undefined for the type DateFormat"
Any ideas please?
I'm trying to convert a time input by the user in the format HH:mm into an actual Time so I can compare it to the current time.
I thought that one way to do this might be to convert it to a date so tried the following:
String time = "0000-00-00 " + hour + ":" + ":00"; DateFormat formatting ; Date date ; formatting = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); date = (Date)formatting.parse(time);
But I get the error "The method parse(String) is undefined for the type DateFormat"
Any ideas please?