Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
のような文字列形式で 2 つの日付がありますDD/MM/YYYY。date1ここで、条件 if is beforeを書かなければなりませんdate2。これどうやってするの?私を助けてください。
DD/MM/YYYY
date1
date2
これを試して:
SimpleDateFormat curFormater = new SimpleDateFormat("dd/MM/yyyy"); Date date1 = curFormater.parse(date1Str); Date date2 = curFormater.parse(date2Str); if (date1.before(date2)) { }