-
Notifications
You must be signed in to change notification settings - Fork 375
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
Milliseconds in datetime omitted in linux but not windows #284
Comments
Hi @RikSomers. From your test we can't tell how to repro your error. Can you provide a repro script that uses msphpsql? Is the issue with sqlsrv or pdo? |
Hi, I'll try to see if I can create a standalone script that reproduces the error. As for your other questions; |
Hi @RikSomers, I tried the script below on Windows 10 and Ubuntu 16.04 against SQL Server 2008R2 and 2016. In all cases the return value was If I changed the insert value to have 0 milliseconds (
I'm unsure how to proceed as I cannot repro the error. Also you could turn on ODBC tracing?
|
Hi, It might be an issue with the framework we are using then. We are in the middle of some other datetime format issues. |
@RikSomers Any update on this issue? |
Hey, Have been under the weather the last couple of days, so didn't have any time yet to test it out. But it might be a framework related issue rather than a driver issue. |
Thanks @RikSomers I'll close the issue, feel free to reopen it |
i can confirm this behaviour...using:
quering with pdo returns milliseconds for datetime columns es: 2017-04-04 15:55:54.000, |
@ducktype If you think it is a bug maybe it's better to create a new issue with the info you provided here and point to this issue. |
@RikSomers I have same problem with Laravel. Seems like this is not driver issue. But can you give some ideas about what can lead to it? Maybe some connection parameters, or something else? |
Hi!
I've encountered a small bug with datetimes when working on some tests for our application.
I wrote a test that makes sure a certain time can be pulled from the database correctly and within the right format. The test in question looks something like this:
The weird thing is, this test runs fine on a local apache server using msphpsql on a Windows machine using PHP 7.0.
However, on our continuous integration, running a Linux docker image (Ubuntu 16.04) with the same PHP version reports the result as being
2017-10-21 01:52:51
. Notice the lack of milliseconds.Both of the webservers (local and docker) connect to the same database, which is a normal SQL Server. So therefor configuration settings on the database end should not be the problem.
Now, we do not necessarily need the precision of milliseconds, but the way it is now, the test either work on the local machine by providing the milliseconds in the assertion, or they run on our CI by omitting the milliseconds in the assertion.
Am I overlooking something, or is there a discrepency between the linux and windows variants of the driver?
The text was updated successfully, but these errors were encountered: