1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-01-17 14:18:35 +01:00

[HinduTamilBridge] Fix timestamp again (#4142)

This commit is contained in:
tillcash 2024-06-29 00:21:59 +05:30 committed by GitHub
parent adad9d6405
commit d0c35146dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,7 +66,7 @@ class HinduTamilBridge extends FeedExpander
$date = $dom->find('p span.date', 1); $date = $dom->find('p span.date', 1);
if ($date) { if ($date) {
$item['timestamp'] = $date->innertext . ' IST'; $item['timestamp'] = $this->convertToRFC3339($date->plaintext);
} }
$content = $dom->find('#pgContentPrint', 0); $content = $dom->find('#pgContentPrint', 0);
@ -88,4 +88,16 @@ class HinduTamilBridge extends FeedExpander
return $content; return $content;
} }
private function convertToRFC3339($DateString)
{
$timestamp = strtotime(trim($DateString));
if ($timestamp !== false) {
$rfc3339DateTime = date('Y-m-d\TH:i:s', $timestamp) . '+05:30';
return $rfc3339DateTime;
} else {
return null;
}
}
} }