在Joda-Time,有没有办法获得一周的第一天(星期一)的日期.
例如,我想根据今天的当前日期21/01/11找出这个星期一星期一的日期
提前干杯.
编辑:我也希望找到一周结束的日期,即星期日的日期.干杯
我想获取一周的第一个日期.
我的输入将是像2014年7月26日的字符串类型".
我需要获得上述日期(2014年7月26日)的第一周日期.
我需要MM/dd/YYYY格式的输出日期.
基本上我需要输出为07/21/2014.
请给我java程序.我已经做到了这一点
SimpleDateFormat formatter1 = new SimpleDateFormat("MM/dd/yy");
String date ="07/26/2014";
Date Currentdate = formatter1.parse(date);
int currentday=Currentdate.getDay();
Calendar calendar = Calendar.getInstance();
calendar.setTime(Currentdate);
int startDay=currentday-calendar.getFirstDayOfWeek();
Currentdate.setDate(contacteddate.getDate()-startDay);
System.out.println(contacteddate.getDate());
}
Run Code Online (Sandbox Code Playgroud)
上面的代码只给我一个日期..我需要在"MM/dd/YYYY"中的日期和月份和年份请帮助
我有一个约会,如何让所有日期落在给定日期属于java的那一周?
example:
if i give today's date then i should get all dates belonging to this week.
12 July 2015 to 18 July 2015
Run Code Online (Sandbox Code Playgroud)
请有人帮助我.
我想知道给定日期的星期日期,我已解释为什么这个问题不重复,请在评论前阅读.