mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-17 14:18:35 +01:00
[GenshinImpactBridge] Use Asia/Shanghai time zone for article dates (#2040)
This commit is contained in:
parent
b754d14698
commit
ff0c7a9013
@ -37,11 +37,14 @@ class GenshinImpactBridge extends BridgeAbstract {
|
||||
$article_res = getContents($article_url)
|
||||
or returnServerError('Error while downloading the website content');
|
||||
$article_json = json_decode($article_res, true);
|
||||
$article_time = $article_json['data']['start_time'];
|
||||
$timezone = 'Asia/Shanghai';
|
||||
$article_timestamp = new DateTime($article_time, new DateTimeZone($timezone));
|
||||
|
||||
$item = array();
|
||||
|
||||
$item['title'] = $article_json['data']['title'];
|
||||
$item['timestamp'] = strtotime($article_json['data']['start_time']);
|
||||
$item['timestamp'] = $article_timestamp->format('U');
|
||||
$item['content'] = $article_json['data']['content'];
|
||||
$item['uri'] = $this->getArticleUri($json_item);
|
||||
$item['id'] = $json_item['contentId'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user