Skip to content

Instantly share code, notes, and snippets.

@ismailkocacan
Created April 21, 2014 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismailkocacan/11156118 to your computer and use it in GitHub Desktop.
Save ismailkocacan/11156118 to your computer and use it in GitHub Desktop.
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