I have seen the \"solution\" at http://www.rgagnon.com/javadetails/java-0506.html, but it doesn\'t work correctly. E.g. yesterday (June 8) should have been 159, but it said
DateFormat d = new SimpleDateFormat("D"); System.out.println(d.format(date));