Current date and time
# support
h
I asked my assistant date and time and it game me wrong output can we make sure whenere I call the assistant i get current date and time.
v
Hi there! 👋 I understand you're having an issue with your assistant providing the wrong date and time. While I don't know exactly what incorrect output you received, I can definitely help you ensure your assistant always provides the correct date and time. Here's how you can make sure your assistant always provides the current date and time correctly: ### 1. Use Dynamic Variables in Your System Prompt The most effective way to ensure your assistant provides the correct date and time is to include it directly in your system prompt using dynamic variables. According to the [Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables), you can use:
Copy code
The current date is {{ "now" | date: "%A, %B %d, %Y", "YOUR_TIMEZONE" }} 
and the time is {{ "now" | date: "%I:%M %p", "YOUR_TIMEZONE" }}
Replace
YOUR_TIMEZONE
with your actual timezone (e.g., "America/New_York", "Australia/Melbourne"). ### 2. Use Separate Variables for Date, Time, and Day For better accuracy, use separate variables for date, time, and day of the week. According to [user discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341751641547870281), this helps the assistant correctly determine all components:
Copy code
Current date: {{ "now" | date: "%B %d, %Y", "YOUR_TIMEZONE" }}
Current time: {{ "now" | date: "%I:%M %p", "YOUR_TIMEZONE" }}
Current day: {{ "now" | date: "%A", "YOUR_TIMEZONE" }}
### 3. Ensure Proper Timezone Configuration Make sure you're explicitly specifying the correct timezone in your formatting. According to [troubleshooting information](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342347443114872863), timezone handling needs to be explicit in the system prompt context. ### 4. Consider Model Selection
Some users have found that changing the LLM from 4o-mini to 4o, or changing the time to ISO format helped resolve date/time issues, as mentioned in [community discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325196797102260304). Is there anything specific about your date/time issue that I can help troubleshoot further? Sources: - [Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables) - [User discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341751641547870281) - [Troubleshooting information](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342347443114872863) - [Community discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325196797102260304)
s
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!