Skip to content
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

[5.5] Added timezone param for now and today helpers #20716

Merged
merged 2 commits into from
Aug 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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