How to get calendar from date
<p>I have some date and I want to get last x day before this date so this is my code:</p>

<pre><code>            Calendar today = Calendar.getInstance();
            today.add(Calendar.DATE, -x);
            date = new Date(today.getTimeInMillis()))
</code></pre>

<p>this code works only if some day is actual day. How I can change it. Is there some method to get calendar from date ?</p>
