Not able to convert date to epoch time : <p>This is my sample code</p>

<pre><code>    String dt = "Oct 24 2019 12:00:00.000 AM UTC";
    String dt1="Oct 24 2019 11:59:59.000 PM UTC";
    SimpleDateFormat df = new SimpleDateFormat("MMM dd yyyy HH:mm:ss.SSS 
    aa zzz");
    Date date = df.parse(dt);
    Date date1 = df.parse(dt1);
    long epoch = date.getTime();
    long epoch1 = date1.getTime();
    System.out.println(epoch);
    System.out.println(epoch1);
</code></pre>

<p>Here specifying the AM and PM but its not taking the value for that and throwing the exception as</p>

<pre><code>{"error_code":"INVALID_PARAMETER_VALUE","message":"Time range must have a start time earlier than the end time"}

</code></pre>

<p>How to specify AM/PM in the java code.
How can I take yesterday's date and time for today in java code as an input to convert to epoch.</p>
