Skip to content

[Bug]: Timezone is changed and not changed back #310

@robgridley

Description

@robgridley

Software Version

6.8.1

Language Version

8.1.11

Operating System

Ubuntu

What happened?

Your client is forcing the timezone to UTC to get a UTC timestamp in microseconds, but you're not switching it back. Line 186 in lib/EasyPost/Http/Requestor.php.

What was expected?

As of PHP 7.1 the built-in DateTime class supports microseconds. You can create a new DateTime instance, change the timezone of the instance to UTC, then format it as a timestamp. You could also store the current timezone, set it to UTC, call microtime(), then change the timezone back.

Sample Code

No response

Relevant logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssue is being researched

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions