public static Date strToDate(String dateStr) throws ParseException {
        return strToDate(dateStr, DATE_FORMAT_TIME);
    }
@Test
    public void strToDate() throws Exception {
        long d0 = 0l;
        long d1 = 1501127802000l; // 2017-07-27 11:56:42:975 +8
        long d2 = 1501127835000l; // 2017-07-27 11:57:15:658 +8
        TimeZone timeZone = TimeZone.getDefault();
        Date date0 = new Date(d0 - timeZone.getOffset(d0));
        Date date1 = new Date(d1 - timeZone.getOffset(d1));
        Date date2 = new Date(d2 - timeZone.getOffset(d2));

        String s0 = "1970-01-01 00:00:00";
        String s1 = "2017-07-27 03:56:42";
        String s2 = "2017-07-27 03:57:15";

        Assert.assertEquals(DateUtils.strToDate(s0).getTime(), date0.getTime());
        Assert.assertEquals(DateUtils.strToDate(s1).getTime(), date1.getTime());
        Assert.assertEquals(DateUtils.strToDate(s2).getTime(), date2.getTime());

    }