Merge pull request #15 from JonOfUs/main

Solve timezone problems in episode change synchronization
This commit is contained in:
thrillfall 2021-07-27 00:02:22 +02:00 committed by GitHub
commit bf4eabc534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Controller; namespace OCA\GPodderSync\Controller;
use DateTime; use DateTime;
use DateTimeZone;
use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7\Response;
use OCA\GPodderSync\Core\EpisodeAction\EpisodeActionReader; use OCA\GPodderSync\Core\EpisodeAction\EpisodeActionReader;
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionEntity; use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionEntity;
@ -110,6 +111,7 @@ class EpisodeActionController extends Controller {
private function convertTimestampToDbDateTimeString(string $timestamp) private function convertTimestampToDbDateTimeString(string $timestamp)
{ {
return \DateTime::createFromFormat('D F d H:i:s T Y', $timestamp) return \DateTime::createFromFormat('D F d H:i:s T Y', $timestamp)
->setTimezone(new DateTimeZone('UTC'))
->format("Y-m-d\TH:i:s"); ->format("Y-m-d\TH:i:s");
} }
} }