Why are Java Date objects designed so that you can't get the date?
<p>Why does Java make it not obvious how to get the day of the month from a Date object?</p>

<p><code>.getDay()</code> was deprecated, it is recommended to use <code>Calendar.get(Calendar.MONTH)</code></p>

<p>This makes little sense to me and I was curious what the rationale behind this deprecation is.</p>

<p>I have a Date object and I just want the day. It's the most natural thing ever and I can't invoke it. This design is wrong and therefore my code is not working the way it should:</p>

<pre><code>private String getIngivningsDag() {

    return ""+ingivningsDatum.getDate();
}



private String getIngivningsMonth() {

    return ""+ingivningsDatum.getmonth();
}

private String getIngivningsYear() {

    return ""+ingivningsDatum.getYear();
}
</code></pre>

<h2>Update</h2>

<p>here's the "solution":</p>

<pre><code>public String getIngivningsDag() {

    Calendar cal = Calendar.getInstance();
    cal.setTime(ingivningsDatum);
    return cal.get(Calendar.DAY_OF_WEEK_IN_MONTH)+"";
}
</code></pre>

<p>Here's how it should look simple and good without the design errors of Java and using method parameters instead of strange Class methods and factories:</p>

<pre><code>public String getIngivningsDag() {

    return ingivningsDatum.getDay(Calendar.GREGORIAN, "SE");
}
</code></pre>
