вывод времени и форматирование
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
a96240d561
commit
804bea284a
9
bot.py
9
bot.py
@ -16,11 +16,12 @@ dp = Dispatcher(bot)
|
|||||||
|
|
||||||
@dp.message_handler(commands=["time"])
|
@dp.message_handler(commands=["time"])
|
||||||
async def send_time(message: types.Message):
|
async def send_time(message: types.Message):
|
||||||
current_datatime = datetime.datetime.now()
|
cd = datetime.datetime.now().strftime("%d/%m/%Y")
|
||||||
# current_data = datatime.date()
|
ct = datetime.datetime.now().strftime('%H:%M')
|
||||||
# current_time = datatime.time()
|
ct = ct+datetime.timedelta(hours=14)
|
||||||
|
ct2 = ct.strftime('%H:%M')
|
||||||
# new_year = datetime.date(2022, 12, 31)
|
# new_year = datetime.date(2022, 12, 31)
|
||||||
await message.reply(f'сегодня, {current_datatime}') #отображение времени, пока не рабоатет
|
await message.reply(f'Сегодня {cd}\nВремя: {ct2}') #отображение времени, пока не рабоатет
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user