In one of my XPages applications I needed a lot of date manipulation. I came at a point to create a DateUtilts class with, in opinion, very useful Date and Calendar methods.
XSnippets
I have uploaded on it to XSnippets, so everyone can benefit from it.
An example
Is today between 2 dates
1 2 3 4 5 6 7 | SimpleDateFormat sdf = new SimpleDateFormat( "dd-MM-yyyy" ); String dateStartInString = "31-08-2015" ; String dateEndInString = "31-08-2016" ; Date dateStart = sdf.parse(dateStartInString); Date dateEnd = sdf.parse(dateEndInString); System.out.println(DateUtils.isTodayInBetween(dateStart, dateEnd)); |
output = true
Happy coding