PHPackages                             tobya/laravel-mssql-dateformat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tobya/laravel-mssql-dateformat

ActiveLaravel-package[Utility &amp; Helpers](/categories/utility)

tobya/laravel-mssql-dateformat
==============================

Check and set MSSQL universal date format used by Laravel to 'Ymd' to ensure universal compatibility

v0.6(1y ago)23.8k↑50%3[1 PRs](https://github.com/tobya/laravel-mssql-dateformat/pulls)MITPHP

Since Dec 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tobya/laravel-mssql-dateformat)[ Packagist](https://packagist.org/packages/tobya/laravel-mssql-dateformat)[ RSS](/packages/tobya-laravel-mssql-dateformat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

MSSQL Dateformat Fixer
======================

[](#mssql-dateformat-fixer)

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 and is NOT universal and incorrectly interprets `Y-m-d` as `Y-d-m` which is beyond idiotic. Laravel uses `Y-m-d` as their international format, which can lead to errors depending on SQL SERVER Settings.

There is one format `Ymd` which is absolutely gauranteed to always be interpreted by SQLServer as `Ymd`. This command patches the file in 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 was too big to be made.

I hope this is helpful to those of you out there using MSSQL with PHP/Laravel.

Installation
------------

[](#installation)

Install with composer

```
composer require tobya/laravel-mssql-dateformat
```

### To Run

[](#to-run)

Run by calling the larvel command

```
php artisan mssql:check-universal-date --update
```

You can run without `--update` to do the check without patching the file.

Configuration
-------------

[](#configuration)

It is suggested that you add the following to your project `composer.json` file so this command is automatically run on install and update.

```
"scripts": {
        "post-update-cmd": [
            "@php artisan mssql:check-universal-date --update"
        ],
        "post-install-cmd": [
            "@php artisan mssql:check-universal-date --update"
        ]
   }
```

This is due to the fact that whenever `composer update` or `composer install` is run and the illuminate package is updated it will overwrite the `SqlServerGrammar.php` with the origional version, so it is necessary to call the command whenever this has the potential of happening. If no change has been made to the file it will not be modified.

#### Further reading on why this is necessary

[](#further-reading-on-why-this-is-necessary)

This is discussed in several places online

- [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)
- [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)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance63

Regular maintenance activity

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~94 days

Recently: every ~118 days

Total

6

Last Release

393d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a881e781ccf5267bc2c9153c0485a6b7b0fbfeaf212dcfcca6a4dd18885a48ee?d=identicon)[tobya](/maintainers/tobya)

---

Top Contributors

[![tobya](https://avatars.githubusercontent.com/u/325502?v=4)](https://github.com/tobya "tobya (4 commits)")[![tushargugnani](https://avatars.githubusercontent.com/u/5244323?v=4)](https://github.com/tushargugnani "tushargugnani (1 commits)")

### Embed Badge

![Health badge](/badges/tobya-laravel-mssql-dateformat/health.svg)

```
[![Health](https://phpackages.com/badges/tobya-laravel-mssql-dateformat/health.svg)](https://phpackages.com/packages/tobya-laravel-mssql-dateformat)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
