Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

withTimeZone is not working #139

Closed
rocwenlinux opened this issue Mar 26, 2018 · 2 comments
Closed

withTimeZone is not working #139

rocwenlinux opened this issue Mar 26, 2018 · 2 comments

Comments

@rocwenlinux
Copy link

Hi, here is my code:
MysqldConfig config = aMysqldConfig(v5_7_19)
.withPort(3380)
.withUser("test","Test123")
.withTimeZone(TimeZone.getDefault())
.build();
EmbeddedMysql mysqld = anEmbeddedMysql(config)
.addSchema("test", classPathScript("/test_data_set.sql"))
.start();

I have tried both withTimeZone(TimeZone.getDefault()) and withTimeZone("Europe/Stockholm") .
After MySQL startup, I connect with MySQL workbench, select Now() is always 1 hour earlier than real time.
The screenshot is attached, the time is exactly same, just hour diff 1.
The special is the day-saving time just changed in Stockholm on Sunday (yesterday). The returned of Now() is the time before the day-saving change.

image

@rocwenlinux
Copy link
Author

My OS is Ubuntu 16.04 64bit.

@viliusl
Copy link
Collaborator

viliusl commented Apr 26, 2018

Ok, so I'm no expert on mysql, but we have a test for timezone - https://github.com/wix/wix-embedded-mysql/blob/master/wix-embedded-mysql/src/test/scala/com/wix/mysql/EmbeddedMysqlTest.scala#L49 and I do trust tests are correct unless proven otherwise. Maybe you could take a look @ the test and try to make it fail? I mean improve assertion if it's incomplete?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants