Getting Last Friday of The Month in Java

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@bijendrachauhan·
0.000 HBD
Getting Last Friday of The Month in Java
public Date getLastFriday( int month, int year ) { Calendar cal = Calendar.getInstance(); cal.set( year, month + 1, 1 ); cal.add( Calendar.DAY_OF_MONTH, -( cal.get( Calendar.DAY_OF_WEEK ) % 7 + 1 ) ); return cal.getTime(); }

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@bijendrachauhan/getting-last-friday-of-the-month-in-java">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 ,