in my Android application, i am taking date and time from database. but i am not able to get the date in the "Date" Format from the database into my application, the date is in string format, so i am not able to compare the system date to database date. if i convert the system date into string then i am not able to update the date into the database in recurring case. i also want to update the database date if the system date and database date is matched.
how can i achieve this is android.
Thanks in advance.
Try this code:
You can convert String to Date like this:
And back to String
And Date has before and after methods and can be compared to each other.
By the way there is also a library called Joda, you can also check it out.