Skip to content

Commit 80c8746

Browse files
authored
Update readme.md
1 parent 2434ca4 commit 80c8746

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

readme.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# MSSQL Dateformat Fixer
22

3-
There is an international date format `Y-m-d` that is supposed to be universal, however the MSSQL implementation is flawed
3+
There is an [international date format (ISO standard)](https://www.iso.org/iso-8601-date-and-time-format.html) (YYYY-MM-DD) `Y-m-d` that is supposed to be universal, however the MSSQL implementation is flawed
44
and is NOT universal and incorrectly interprets `Y-m-d` as `Y-d-m` which is beyond idiotic.
55
Laravel uses `Y-m-d` as their international format, which can lead to errors depending on SQL SERVER Settings.
66

77
There is one format `Ymd` which is absolutely gauranteed to always be interpreted by SQLServer as `Ymd`. This command patches the file in
8-
illuminate library to use `Ymd` instead of `Y-m-d`. I [Requested]() that the change be made in the illuminate library but it was felt the change
8+
illuminate library to use `Ymd` instead of `Y-m-d`. I [Requested](https://github.com/laravel/framework/issues/49074) that the change be made in the illuminate library but it was felt the change
99
was too big to be made.
1010

1111
I hope this is helpful to those of you out there using MSSQL with PHP/Laravel.
@@ -46,3 +46,10 @@ This is due to the fact that whenever `composer update` or `composer install` is
4646
is updated it will overwrite the `SqlServerGrammar.php` with the origional version, so it is necessary to call
4747
the command whenever this has the potential of happening. If no change has been made to the file it will
4848
not be modified.
49+
50+
#### Further reading on why this is necessary
51+
52+
This is discussed in several places online
53+
54+
- [sqlblog.org/2009/10/16/bad-habits-to-kick-mis-handling-date-range-queries](https://sqlblog.org/2009/10/16/bad-habits-to-kick-mis-handling-date-range-queries)
55+
- [stackoverflow.com/questions/19565320/why-is-sql-server-misinterpreting-this-iso-8601-format-date](https://stackoverflow.com/questions/19565320/why-is-sql-server-misinterpreting-this-iso-8601-format-date)

0 commit comments

Comments
 (0)