I have One value of date time like "30-01-2014 22:50".
I have database of Date with same format but in datatype is String.
Now I want nearest time from database of given date-time "30-01-2014 22:50".
Example :
Value I have :"30-01-2014 22:50"
Database :
"30-01-2014 02:20"
"30-01-2014 05:30"
"30-01-2014 22:55"
"30-01-2014 10:50"
"30-01-2014 22:54"`
So the output should be.
"30-01-2014 22:54"
How can I achieve this?
date1.after(date2) and date1.before(date3)
Is there any kind of function for time?
Thanks