Skip to content

Commit

Permalink
[5.5] Added timezone param for now and today helpers (#20716)
Browse files Browse the repository at this point in the history
* added timezone param for now and today helpers

* Update v5.5 changelog
  • Loading branch information
nyanlynnhtut authored and taylorotwell committed Aug 24, 2017
1 parent 2f2886e commit 6af02f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-5.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
- Support multiple patterns in `Str::is()` ([#20108](https://github.com/laravel/framework/pull/20108))
- Speed up `Arr::get()` calls without dot notations ([#20139](https://github.com/laravel/framework/pull/20139))
- Use `report()` helper in `mix()` ([#20603](https://github.com/laravel/framework/pull/20603), [bf0cb82](https://github.com/laravel/framework/commit/bf0cb82a8990d99a0ed504c2fa6684b1c59c9d7e))
- Added `now()` and `today()` helpers ([#3c888b6](https://github.com/laravel/framework/commit/3c888b6c7b89c3d3f90e9024ffbebed3ee80bd23))

### Localization
- ⚠️ Moved `LoaderInterface` to contracts ([#20460](https://github.com/laravel/framework/pull/20460))
Expand Down
10 changes: 6 additions & 4 deletions src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,12 @@ function mix($path, $manifestDirectory = '')
/**
* Create a new Carbon instance for the current time.
*
* @param \DateTimeZone|string|null $tz
* @return \Illuminate\Support\Carbon
*/
function now()
function now($tz = null)
{
return Carbon::now();
return Carbon::now($tz);
}
}

Expand Down Expand Up @@ -823,11 +824,12 @@ function storage_path($path = '')
/**
* Create a new Carbon instance for the current date.
*
* @param \DateTimeZone|string|null $tz
* @return \Illuminate\Support\Carbon
*/
function today()
function today($tz = null)
{
return Carbon::today();
return Carbon::today($tz);
}
}

Expand Down

0 comments on commit 6af02f3

Please sign in to comment.