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

Timezones supported? Nice would be the support of the DateTimeInterface #22

Open
rotdrop opened this issue Sep 28, 2021 · 1 comment
Open

Comments

@rotdrop
Copy link

rotdrop commented Sep 28, 2021

Is there support for time-zones for date-time formatting? Nice-to-have would also the support of the DateTimeInterface of PHP, which then would come with its builtin timezones.

Of course, I always can do $date->timeStamp(), but then: how do I pass the timezone to OpenTBS?

Thanks

@rotdrop
Copy link
Author

rotdrop commented Sep 28, 2021

A work-around, but "native" support would be nicer (need to check about the +/- with the offset):

 array_walk_recursive($this->backend->VarRef, function(&$value, $key) {
      if ($value instanceof \DateTimeInterface) {
        $stamp = $value->getTimestamp();
        $stamp -= $value->getOffset();
        $value = $stamp;
      }
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant