def send_welcome(message): try: text = ' '.join(message.text.split()[1:]).strip() response = datetime.now(timezone(text)).strftime('%H:%M') except Exception as e: response = str(e) bot.reply_to(message, response)
def test_timezone(self): ''' Check if correct timezones are loaded. ''' for location, _, timezone_id in self.COORDINATE_FIXTURES: self.assertEqual(timezone(location), timezone_id)
def test_direct_timezone(self): ''' Check if directly passing timezones works. ''' self.assertEqual(timezone('Asia/Calcutta'), l_timezone('Asia/Calcutta'))