This repository has been archived on 2023-06-09. You can view files and clone it, but cannot push or open issues or pull requests.
jarvis-server/intents/daily/date_and_time/intent.py

21 lines
493 B
Python
Raw Normal View History

import time
2021-07-26 18:23:32 +02:00
import utils.intents_utils
from utils import config_utils
2021-07-26 18:23:32 +02:00
def what_time_is_it():
current_time = time.localtime()
response = utils.intents_utils.get_response("what_time_is_it")
if config_utils.get_in_config("12HOURS-FORMAT"):
response = response.replace('{time}', time.strftime("%I:%M %p", current_time))
else:
response = response.replace('{time}', time.strftime("%H:%M", current_time))
return response
2021-07-26 18:23:32 +02:00
def what_day_is_it():
return ""