fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pavel_Duron 2022-11-03 19:01:45 +10:00
parent 8bd92463d2
commit 329c110061

5
bot.py
View File

@ -16,13 +16,14 @@ dp = Dispatcher(bot)
@dp.message_handler(commands=["time"])
async def send_time(message: types.Message):
new_year = datetime.date(2022, 12, 31)
cd = datetime.datetime.now().strftime("%d/%m/%Y") #дата
ct = datetime.datetime.now() #датавремя
ct = ct+datetime.timedelta(hours=14) # +14 часов от сервера
ct2 = ct.strftime('%H:%M') # форматирует датувремя просто во время
new_year = datetime.date(2022, 12, 31)
differ = new_year - ct
await message.reply(f'Сегодня {cd} \nВремя: {ct2} \nДо Нового Года осталось {differ.days} дней(-я)')
await message.reply(f'Сегодня {cd} \nВремя: {ct2} \nДо Нового Года осталось {differ} дней(-я)')