forked from Pavel_Durov/python_bot
		
	fix
This commit is contained in:
		
							
								
								
									
										5
									
								
								bot.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								bot.py
									
									
									
									
									
								
							| @@ -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} дней(-я)') | ||||
|      | ||||
|      | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user