import requests as r
from bs4 import BeautifulSoup as bs
channel = 'https://t.me/s/testchannel5'
page = r.get(channel)
soup = bs(page.content, 'html.parser')
date_post = soup.find_all('span', class_='tgme_widget_message_meta')[-1].text
print(date_post)
import requests as r
from bs4 import BeautifulSoup as bs
from datetime import *
channel = 'https://t.me/s/testchannel5'
page = r.get(channel)
soup = bs(page.content, 'html.parser')
date_post = soup.find_all('span', class_='tgme_widget_message_meta')[-1].text # -1 – индекс поста
long_time = datetime.strptime(date_post, '%H:%M') + timedelta(hours=3)
correct_time = long_time.strftime('%H:%M')
print(correct_time)