New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeshift when column is type of `date` #328

Closed
hrach opened this Issue Jan 6, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@hrach
Copy link
Member

hrach commented Jan 6, 2019

To Reproduce

/**
 * @property \DateTimeImmutable $birthday
 */
class User extends BaseEntity {
}

$values->birthday; // DateTime 2000-08-14
$user->birthday = $values->birthday; // DateTime 2000-08-14

Sends query with 2000–08–13 23:00:00.000000 which is stored as different day.

Versions::

  • Database: MySQL

@hrach hrach added the 1-bug label Jan 6, 2019

@hrach

This comment has been minimized.

@hrach

This comment has been minimized.

Copy link
Member

hrach commented Jan 6, 2019

Adding another key 'DATE' => true here should help and fix this bug. https://github.com/nextras/orm/blob/v3.0.1/src/Mapper/Dbal/StorageReflection/StorageReflection.php#L297 Could you try if it fix it?

Thank you for the reporting, this is longstanding issue and finally someone describe it more accurately :)

@Sitole

This comment has been minimized.

Copy link
Contributor

Sitole commented Jan 6, 2019

You are right. Fixed #329

@hrach

This comment has been minimized.

Copy link
Member

hrach commented Jan 9, 2019

Fixed in e179903
Will backport to 3.0 and release new 3.0.2 version tomorrow.

@hrach hrach closed this Jan 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment