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