how to get the number of minutes from a specific time up to the current time using java.util.Date?
<p>so i have this homework and this is the given problem:</p>

<p>Per-minute charging offers at 75 cents a minute from 5:01 am to 5:00 pm, and 90 cents a minute from 5:01 pm to 5:00 am.</p>

<p>this is my code: </p>

<pre><code>double charge = 0;

Date date = new Date();

if(date.getHours() &gt;= 5 &amp;&amp; date.getHours() &lt;= 17)
{
    charge += 0.75 * date.getMinutes();
    System.out.println(charge);
}
else
{
    charge += 0.9 * date.getMinutes();
    System.out.println(charge);
}
</code></pre>

<p>my problem is that the date.getMinutes() only gets the current minute of the current hours,
it supposed to be the number of minutes from 5:01am up to the current time and the else statement likewise. any idea guys? thx alot! </p>
