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

Is there an easy way to set the default timezone for all api calls? #285

Closed
phpdave opened this issue Dec 2, 2016 · 1 comment
Closed
Labels
V2 V2 Client

Comments

@phpdave
Copy link

phpdave commented Dec 2, 2016

Problem:
I was saving the creation time of transaction in the database with

$transaction = Recurly_Transaction::get($id); 
$creationdatetime = $transaction->created_at->format('Y-m-d H:i:s')

But that date and time aren't in my timezone, so Now I have to set the timezone every time before I save it or use it

$transaction = Recurly_Transaction::get($id); 
$creationdatetime  = $transaction->created_at->setTimezone(new DateTimeZone('America/New_York'))->format('Y-m-d H:i:s');

Is there a way to make the created_at property to always be set to my timezone?

I may just write a wrapper around the class to do this, but I thought I'd see if there was already a way around this.

@phpdave
Copy link
Author

phpdave commented Dec 2, 2016

Nevermind, I just realized with daylights savings time its always best to use Zulu timezone

@phpdave phpdave closed this as completed Dec 2, 2016
@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

No branches or pull requests

2 participants