Data mask

Asked

Viewed 37 times

1

I am using a Jformattedtextfield with the mask (##:##) for the user to enter an hour and my program to search the database returning the values corresponding to this time.

My problem is that in the database the information is without the ":", IE, if the user enters "15:00" will not return anything, because it is registered as 1500. The time data format in the database is INT.

Does anyone have an idea how I can solve this?

Thank you

1 answer

1


You can use the method replace().

Example:

String hora = "15:00";
String novaHora = hora.replace(":", "");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.