# -*- coding: utf-8-*-
import datetime
import re
from client.app_utils import getTimezone
from semantic.dates import DateService

WORDS = ["TIME"]


def handle(text, mic, profile):
    """
        Reports the current time based on the user's timezone.

        Arguments:
        text -- user-input, typically transcribed speech
        mic -- used to interact with the user (for both input and output)
        profile -- contains information related to the user (e.g., phone
                   number)
    """

    tz = getTimezone(profile)
    now = datetime.datetime.now(tz=tz)
    service = DateService()
    response = service.convertTime(now)
    mic.say('I',"It is %s right now." % response)


def isValid(text):
    """
        Returns True if input is related to the time.

        Arguments:
        text -- user-input, typically transcribed speech
    """
    return bool(re.search(r'\btime\b', text, re.IGNORECASE))

@@ -138,16 +138,43 @@
  %5B%22TIME%22
+, %22WHAT%22, %22IS%22, %22IT%22, %22THE%22
 %5D%0A%0A%0Adef 
@@ -895,61 +895,131 @@
     
-return bool(re.search(r'%5Cbtime%5Cb', text, re.IGNORECASE))
+if text.lower() == %22what time is it%22 or text.lower() == %22what is the time%22:%0A        return True%0A    else:%0A        return False
 %0A

fix time to work with knowItAll