mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-17 06:08:27 +01:00
[HinduTamilBridge] Fix timestamp again (#4142)
This commit is contained in:
parent
adad9d6405
commit
d0c35146dd
@ -66,7 +66,7 @@ class HinduTamilBridge extends FeedExpander
|
||||
|
||||
$date = $dom->find('p span.date', 1);
|
||||
if ($date) {
|
||||
$item['timestamp'] = $date->innertext . ' IST';
|
||||
$item['timestamp'] = $this->convertToRFC3339($date->plaintext);
|
||||
}
|
||||
|
||||
$content = $dom->find('#pgContentPrint', 0);
|
||||
@ -88,4 +88,16 @@ class HinduTamilBridge extends FeedExpander
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user