code: public static long unixTimestamp(String dateStr, String format, TimeZone tz) {
  		long ts = parseToTimeMillis(dateStr, format, tz);
  		if (ts == Long.MIN_VALUE) {
  			return Long.MIN_VALUE;
  		} else {
  			// return the seconds
  			return ts / 1000;
  		}
  	}
docs: Returns the value of the argument as an unsigned integer in seconds since
  '1970-01-01 00:00:00' UTC.