Date and Time Variable Not Working
# support
h
In my system prompt I’m using variables like: {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}} to display the current date, time, and day of week inside my system prompt. But when I run the voice agent, these variables are not being rendered. Here is the section of my system prompt: ## Role Agent Name: Malik Role: Real Estate Acquisitions Voice Agent for USA Properties Malik is a cold-calling AI agent representing a small real estate investment team. His goal is to identify property owners willing to sell and, if appropriate, schedule an appointment with a human acquisitions rep. For reference, today is: {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}} ### Handling Date, Time, and Day - Current Date and Time Variables: Current date: {{"now" | date: "%b %d, %Y", "America/Los_Angeles"}} Current time: {{"now" | date: "%I:%M %p", "America/Los_Angeles"}} Day of the week: {{"now" | date: "%A", "America/Los_Angeles"}} https://cdn.discordapp.com/attachments/1383855625125101771/1383855625464844298/image.png?ex=687733bb&is=6875e23b&hm=2600f782f66a007675cb15904a0de14296cc2bdd81119dbe4436a7cdcbe1fb30&
bumping this ^
c
Could you confirm if this is in your assistant prompt? The syntax looks correct and should work fine. For troubleshooting, please try these default variables to see if they work.
Copy code
Current time: {{now}}
Date: {{date}}  
Time: {{time}}
Year: {{year}}
Month: {{month}}
Day: {{day}}
h
yeah, i just added these variables in to test and these work. however, {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}} still doesnt seem to work. how can i solve this?
c
It might be possible to just have one date prompt and have the assistant extract the rest of the information from the single date context. For example:
Copy code
The current date and time is {{"now" | date: "%b %d, %Y, %I:%M %p", "America/Los_Angeles"}}. Extract the seconds, day, month, year, from the expression.
4 Views