JARVIS / app /utils /time_info.py
coder-vansh's picture
jarvis initial deploy
f175d26
raw
history blame contribute delete
762 Bytes
"""
TIME INFORMATION UTILITY
========================
Returns a short, readable string with the current date and time. this is
injected into the system prompt so the LLM can answer "what day is it?"
and similar question Called by both GroqService and RealtimeService.
"""
import datetime
def get_time_information() -> str:
now = datetime.datetime.now()
return (
f"Current Real-time Information:\n"
f"Day: {now.strftime('%A')}\n" # e.g. Monday
f"Date: {now.strftime('%d')}\n" # e.g. 05
f"Month: {now.strftime('%B')}\n" # e.g. February
f"Year: {now.strftime('%Y')}\n" # e.g. 2026
f"Time: {now.strftime('%H')} hours, {now.strftime('%M')} minutes, {now.strftime('%S')} seconds\n"
)