public static Date toDateUS(String string) { String[] split = StringScanner.splitByChars(string, new char[] {'.', '\\', '/', ':'}); if (split.length == 3) { return Dates.getUSDate(toInt(split[0]), toInt(split[1]), toInt(split[2])); } else if (split.length >= 6) { return Dates.getUSDate( toInt(split[0]), toInt(split[1]), toInt(split[2]), toInt(split[3]), toInt(split[4]), toInt(split[5])); } else { die(String.format("Not able to parse %s into a US date", string)); return null; } }