+
+
+ /**
+ * Use the given Rational values to create a timestamp
+ * @param inDate rationals describing date
+ * @param inTime rationals describing time
+ * @return Timestamp object corresponding to inputs
+ */
+ private static Timestamp createTimestamp(Rational[] inDate, Rational[] inTime)
+ {
+ //System.out.println("Making timestamp for date (" + inDate[0].toString() + "," + inDate[1].toString() + "," + inDate[2].toString() + ") and time ("
+ // + inTime[0].toString() + "," + inTime[1].toString() + "," + inTime[2].toString() + ")");
+ return new Timestamp(inDate[0].intValue(), inDate[1].intValue(), inDate[2].intValue(),
+ inTime[0].intValue(), inTime[1].intValue(), inTime[2].intValue());
+ }
+
+
+ /**
+ * Use the given String value to create a timestamp
+ * @param inStamp timestamp from exif
+ * @return Timestamp object corresponding to input
+ */
+ private static Timestamp createTimestamp(String inStamp)
+ {
+ Timestamp stamp = null;
+ try
+ {
+ stamp = new Timestamp(Integer.parseInt(inStamp.substring(0, 4)),
+ Integer.parseInt(inStamp.substring(5, 7)),
+ Integer.parseInt(inStamp.substring(8, 10)),
+ Integer.parseInt(inStamp.substring(11, 13)),
+ Integer.parseInt(inStamp.substring(14, 16)),
+ Integer.parseInt(inStamp.substring(17)));
+ }
+ catch (NumberFormatException nfe) {}
+ return stamp;
+ }