Your code will not compile. What is this line supposed to do?
float time=sdf2; "but the current time that i get is in string type" If you do
Date d = new Date(); then you have a Date object that contains the time, not a String. You have to get the date out of the database first and then compare it to the current date in
Java. Do you know how to get the date out of the database?
Please explain in more detail what you are trying to do, post some more of your code - otherwise it will be hard to help you...