Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Cellard committed Jun 1, 2023
1 parent 008843f commit 23ab55b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
@@ -1,6 +1,10 @@
# Cast datetime with timezone for Laravel

Laravel doesn't respect timezone.
[![PHP Composer](https://github.com/C0deWiser/laravel-cast-datetime-tz/actions/workflows/php.yml/badge.svg)](https://github.com/C0deWiser/laravel-cast-datetime-tz/actions/workflows/php.yml)

Laravel doesn't respect timezone. Cast `\Codewiser\Casts\AsDatetimeWithTZ` fixes this wrong behaviour.

## Before

```php
class Article extends \Illuminate\Database\Eloquent\Model
Expand All @@ -24,7 +28,7 @@ echo $model->date->format('c');
// Actual 2000-01-01T10:00:00+01:00
```

Cast `\Codewiser\Casts\AsDatetimeWithTZ` fixes this wrong behaviour.
## After

```php
class Article extends \Illuminate\Database\Eloquent\Model
Expand Down

0 comments on commit 23ab55b

Please sign in to comment.