Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwriter committed Oct 1, 2023
1 parent 5dbcf55 commit 4bad513
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ use Ghostwriter\Clock\FrozenClock;
use Ghostwriter\Clock\LocalizedClock;
use Ghostwriter\Clock\SystemClock;

date_default_timezone_get('America/New_York');
date_default_timezone_set('America/New_York');
$systemClock = new SystemClock(new DateTimeZone(date_default_timezone_get()));
$systemClock->now(); // DateTimeImmutable
$systemClock->now()->getTimezone()->getName(); // America/New_York


date_default_timezone_get('America/Los_Angeles');
date_default_timezone_set('America/Los_Angeles');
$systemClock = SystemClock::create();
$systemClock->now(); // DateTimeImmutable
$systemClock->now()->getTimezone()->getName(); // America/Los_Angeles
Expand Down

0 comments on commit 4bad513

Please sign in to comment.