Example #1
0
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)
Example #2
0
    def test_timezone(self):
        '''
        Check if correct timezones are loaded.
        '''

        for location, _, timezone_id in self.COORDINATE_FIXTURES:
            self.assertEqual(timezone(location), timezone_id)
Example #3
0
    def test_direct_timezone(self):
        '''
        Check if directly passing timezones works.
        '''

        self.assertEqual(timezone('Asia/Calcutta'), l_timezone('Asia/Calcutta'))