package com.icosillion.podengine.utils;

import com.icosillion.podengine.exceptions.DateFormatException;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

    private static SimpleDateFormat[] dateFormats = {
            new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z"),
            new SimpleDateFormat("dd MMM yyyy HH:mm:ss Z"),
            new SimpleDateFormat("EEE, dd MMM yyyy HH:mm Z"),
            new SimpleDateFormat("dd MMM yyyy HH:mm Z")
    };

    public static Date stringToDate(String dt) throws DateFormatException {

        Date date = null;

        for (SimpleDateFormat dateFormat : DateUtils.dateFormats) {
            try {
                date = dateFormat.parse(dt);
                break;
            } catch (ParseException e) {
                //This format didn't work, keep going
            }
        }

        return date;
    }
}

@@ -189,16 +189,41 @@
 il.Date;
+%0Aimport java.util.Locale;
 %0A%0Apublic
@@ -350,32 +350,43 @@
 yyyy HH:mm:ss Z%22
+, Locale.US
 ),%0A            n
@@ -429,16 +429,27 @@
 mm:ss Z%22
+, Locale.US
 ),%0A     
@@ -502,16 +502,27 @@
 HH:mm Z%22
+, Locale.US
 ),%0A     
@@ -570,16 +570,27 @@
 HH:mm Z%22
+, Locale.US
 )%0A    %7D;

Use US Locale for date parser