Created
April 21, 2014 20:50
-
-
Save ismailkocacan/11156118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DateHelper | |
{ | |
/** | |
* İçinde bulunduğumuz haftanın pazartesi gününün tarihi verir. | |
* @return | |
*/ | |
public static Date getDateOfMonday() | |
{ | |
Calendar cal = Calendar.getInstance(); | |
while(cal.get(Calendar.DAY_OF_WEEK)!=Calendar.MONDAY) | |
{ | |
cal.add(Calendar.DAY_OF_MONTH, -1); | |
} | |
Date tarih = new Date(cal.getTimeInMillis()); | |
return tarih; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment