Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v6.9.1 (2023-11-20)

- Fixes a bug that globally reset the timezone to UTC instead of setting the timezone per-request (closes #310)

## v6.9.0 (2023-10-11)

- Deprecates API key-related functions in the `user` service and introduces the replacement functions in the `api_keys` service
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "easypost/easypost-php",
"description": "EasyPost Shipping API Client Library for PHP",
"version": "6.9.0",
"version": "6.9.1",
"keywords": [
"shipping",
"api",
Expand Down
2 changes: 1 addition & 1 deletion lib/EasyPost/Constant/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class Constants
const BETA_API_VERSION = 'beta';

// Library constants
const LIBRARY_VERSION = '6.9.0';
const LIBRARY_VERSION = '6.9.1';
const SUPPORT_EMAIL = 'support@easypost.com';

// Validation
Expand Down
9 changes: 2 additions & 7 deletions lib/EasyPost/Http/Requestor.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ private static function requestRaw($client, $method, $url, $params, $beta = fals
];

$requestUuid = uniqid();
$originalTimezone = date_default_timezone_get();
date_default_timezone_set('UTC');
$requestTimestamp = microtime(true);
$requestTimestamp = (float) (new DateTime('now', new DateTimeZone('UTC')))->format('U.u');
($client->requestEvent)([
'method' => $method,
'path' => $absoluteUrl,
Expand Down Expand Up @@ -226,7 +224,7 @@ private static function requestRaw($client, $method, $url, $params, $beta = fals
$responseHeaders = $response->getHeaders();
}

$responseTimestamp = microtime(true);
$responseTimestamp = (float) (new DateTime('now', new DateTimeZone('UTC')))->format('U.u');
($client->responseEvent)([
'http_status' => $httpStatus,
'method' => $method,
Expand All @@ -238,9 +236,6 @@ private static function requestRaw($client, $method, $url, $params, $beta = fals
'request_uuid' => $requestUuid,
]);

// Reset the timezone after we've done our UTC calculations so we don't affect user code
date_default_timezone_set($originalTimezone);

return [$responseBody, $httpStatus];
}

Expand Down