добавил счетчик нового года
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
63b5d0809b
commit
36940601d3
13
bot.py
13
bot.py
@ -16,12 +16,13 @@ dp = Dispatcher(bot)
|
||||
|
||||
@dp.message_handler(commands=["time"])
|
||||
async def send_time(message: types.Message):
|
||||
cd = datetime.datetime.now().strftime("%d/%m/%Y")
|
||||
ct = datetime.datetime.now()
|
||||
ct = ct+datetime.timedelta(hours=14)
|
||||
ct2 = ct.strftime('%H:%M')
|
||||
# new_year = datetime.date(2022, 12, 31)
|
||||
await message.reply(f'Сегодня {cd} \nВремя:{ct2}') #отображение времени, пока не рабоатет
|
||||
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).strftime("%d/%m/%Y")
|
||||
differ = (new_year - ct2).days
|
||||
await message.reply(f'Сегодня {cd} \nВремя: {ct2} /nДо Нового Года осталось {differ} дней(-я)')
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user