/** * parse the array of date strings and returns the date as seconds * * @param s array of date strings * * @return array of seconds * * @throws java.text.ParseException On badness */ public static double[] toSeconds(String[] s) throws java.text.ParseException { double[] d = new double[s.length]; if (s.length == 0) { return d; } SimpleDateFormat sdf = findFormatter(s[0]); double lastTime = 0; for (int i = 0; i < s.length; i++) { d[i] = sdf.parse(s[i]).getTime() / 1000.0; if (d[i] < lastTime) { System.out.println("****" + s[i]); } // else System.out.println (s[i]); lastTime = d[i]; // System.out.println(d[i]); } return d; }