public static long getEpochValueInSeconds(String epoch) {
        final String seconds;
        if (epoch.length() >= 13) {
            //this is in milliseconds - reduce to seconds
            seconds = epoch.substring(0, 10);
        } else {
            seconds = epoch;
        }
        long results = 0;
        try {
            results = Long.parseLong(seconds);
        } catch (NumberFormatException ex) {
            LOGGER.debug(String.format("Error parsing '%s' property from the database - using zero", epoch), ex);
        }
        return results;
    }
@Test
    public void testGetEpochValueInSeconds() throws ParseException {
        String milliseconds = "1550538553466";
        long expected = 1550538553;
        long result = DateUtil.getEpochValueInSeconds(milliseconds);
        assertEquals(expected, result);

        milliseconds = "blahblahblah";
        expected = 0;
        result = DateUtil.getEpochValueInSeconds(milliseconds);
        assertEquals(expected, result);

        milliseconds = "1550538553";
        expected = 1550538553;
        result = DateUtil.getEpochValueInSeconds(milliseconds);
        assertEquals(expected, result);
    }