static Date toDate(final JsonNode object) {
    if (object instanceof NumericNode) {
      return getDateFromEpochDays(object.asLong());
    }
    if (object instanceof TextNode) {
      try {
        return getDateFromEpochDays(Long.parseLong(object.textValue()));
      } catch (final NumberFormatException e) {
        throw failedStringCoercionException(SqlBaseType.DATE);
      }
    }
    throw invalidConversionException(object, SqlBaseType.DATE);
  }
@Test
  public void shouldConvertStringToDateCorrectly() {
    final Date d = JsonSerdeUtils.toDate(JsonNodeFactory.instance.textNode("10"));
    assertThat(d.getTime(), equalTo(864000000L));
  }