Java Date sorting method?

♀尐吖头ヾ 提交于 2019-12-07 12:00:48

问题


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


回答1:


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

df.parse(datearray[i]).after(new Date()) 


来源:https://stackoverflow.com/questions/2786379/java-date-sorting-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!