code: public static long convert2long(String date, String format) {
          try {
              if (!StringUtil.isEmpty(date)) {
                  if (StringUtil.isEmpty(format))
                      format = dateTimeFormat;
                  SimpleDateFormat sf = new SimpleDateFormat(format);
                  return sf.parse(date).getTime();
              }
          } catch (ParseException e) {
              LOG.error(e);
          }
          return 0l;
      }
docs: 将日期格式的字符串转换为长整型