Search code examples
mysqlspring-bootdockerspring-dataraspbian

Mysql wrong time field in query


Briefing: I'm working with Spring Boot, spring data and a dockerized mySQL database(community version).

  • I have 2 instances of the database, one in a Raspberry Pi(Raspbian) and another in my pc (Ubuntu).
  • The table i'm querying has a "time" field -> '10:00:00'
  • I'm using the default findAll() method from JpaRepository.
  • Ubuntu is in LMT time, set to my zone. Raspbian has GMT or UTC options, also set to my zone(+1).

TL;DR;

Problem: Time field in bbdd table is 10:00:00 in both databases

  • I query the database in my pc, it returns 10:00:00.
  • I query the database in the pi, it returns 11:00:00.

Makes no sense to me. Any ideas? Thanks in advance.


Solution

  • I solved it by installing the same OS in both machines (ubuntu & ubuntu server). Raspbian had something messed up with timezones.