SimpleDateFormat gives API Error
<p>Whenever I use my <code>SimpleDateFormat</code> in android it keep giving me the error call requires API level 24. Which doesn't make sense since I refer to <a href="https://stackoverflow.com/questions/7651221/android-how-to-get-the-current-day-of-the-week-monday-etc-in-the-users-l">this</a> tutorial which was a couple of years old.</p>

<p>This is the code that giving out the error</p>

<p><code>SimpleDateFormat formatter = new SimpleDateFormat("EEE,dd MMM,yyyy HH:mm:ss");</code></p>

<p>I even try but it's still not working</p>

<p><code>SimpleDateFormat formatter = new SimpleDateFormat("EEE,dd MMM,yyyy HH:mm:ss",Locale.US);</code></p>

<p>Here is my method where I'm having problem with</p>

<pre><code>public static long getDateInMillis(String srcDate) {

    SimpleDateFormat formatter = new SimpleDateFormat("EEE,dd MMM yyyy HH:mm:ss");

    long dateInMillis = 0;
    try {
        Date date = formatter.parse(srcDate);
        dateInMillis = date.getTime();
        return dateInMillis;
    }

    catch (java.text.ParseException e) {
        e.printStackTrace();
    }

    return 0;
}
</code></pre>