Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Date sorting method?

I have an String array of dates in the format ex:'2010-05-04 11:26:46 +0530'. How can I check whether a particular date in the array is > today?

thanks

like image 978
Sukitha Udugamasooriya Avatar asked Jan 23 '26 03:01

Sukitha Udugamasooriya


1 Answers

DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");

df.parse(datearray[i]).after(new Date()) 
like image 176
Daniel Avatar answered Jan 25 '26 17:01

Daniel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!