If it really should be single-line, and it doesn't matter if the code is clear, I think the following instruction should work:
Date yesterday = new SimpleDateFormat("yyyyMMdd").parse(
""+(Integer.parseInt(new SimpleDateFormat("yyyyMMdd").format(new Date()))-1));
"yyyyMMdd", . "20100812" int: 20100812, : 20100811, "20100811" . , , 0- DateFormat .
"yyyyDDD" (D - ).
:
Date firstday = new SimpleDateFormat("yyyyMMdd").parse(
new SimpleDateFormat("yyyyMM").format(new Date())+"01");