Conversión horaria miércoles 16 de septiembre de 2020 00:00:00 GMT + 0800 (hora estándar de China)

Visualización cuando se imprime la hora seleccionada:

Formateelo:

dateFormat(dateData) {
      var date = new Date(dateData)
      var y = date.getFullYear()
      var m = date.getMonth() + 1
      m = m < 10 ? ('0' + m) : m
      var d = date.getDate()
      d = d < 10 ? ('0' + d) : d
      const time = y + '-' + m + '-' + d
      return time
    }

Consulta SQL:

@Query(value = "select * from books where date_format(【数据库表时间的字段】,'%Y-%m-%d') = ?1", nativeQuery = true)
    List<Book> findBookByDate(String dateStr);

 

Supongo que te gusta

Origin blog.csdn.net/jack_bob/article/details/108622409
Recomendado
Clasificación