Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit 3f4922c

Browse files
author
Brian Retterer
committed
move timezone from global to the dateTime object. Resolves #176
1 parent c727d72 commit 3f4922c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Http/Authc/SAuthc1Authentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public function __construct(ApiKey $apiKey)
5252

5353
public function authenticate(RequestInterface $request)
5454
{
55-
date_default_timezone_set(self::TIME_ZONE);
5655
$date = new \DateTime();
56+
$date->setTimezone(new \DateTimeZone(self::TIME_ZONE));
5757
$timeStamp = $date->format(self::TIMESTAMP_FORMAT);
5858
$dateStamp = $date->format(self::DATE_FORMAT);
5959

src/Http/Authc/StormpathBasicAuthentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function __construct(ApiKey $apiKey)
4343

4444
public function authenticate(RequestInterface $request)
4545
{
46-
date_default_timezone_set(self::TIME_ZONE);
4746
$date = new \DateTime();
47+
$date->setTimezone(new \DateTimeZone(self::TIME_ZONE));
4848
$timeStamp = $date->format(self::TIMESTAMP_FORMAT);
4949

5050
$authorizationHeader = base64_encode($this->apiKey->getId() . ":" . $this->apiKey->getSecret());

0 commit comments

Comments
 (0)