https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can i access the current date and time within ...
# ❓・ai-evy-support
a
@AI Evy How can i access the current date and time within a call? is there a dynamic variable for this?
a
Thanks for tagging me @advisior_30841. I'll look through relevant sources and get back to you shortly.
### Answer Yes, Retell AI provides several dynamic variables for accessing current date and time within calls [(1) ]() . The primary variable is
{{current_time}}
, which provides the current time in
America/Los_Angeles
timezone . For example, it displays as "Thursday, March 28, 2024 at 11:46:04 PM PST" . You can also access time in specific timezones using
{{current_time_[timezone]}}
. For example: -
{{current_time_Australia/Sydney}}
-
{{current_time_America/New_York}}
[(2) ]() Additionally, there are calendar variables available [(1) ]() : -
{{current_calendar}}
- provides a 14-day calendar in
America/Los_Angeles
-
{{current_calendar_[timezone]}}
- provides a 14-day calendar in the specified timezone These system variables are automatically provided by Retell and require no configuration . You can use them in your prompts, begin messages, tool descriptions, and other parts of your agent configuration .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Simulation Testing Now Live for All Agents](https://www.retellai.com/changelog/simulation-testing-now-live-for-all-agents-c27zh) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
how can i reference this variable in a prompt. will this work for example? @AI Evy LEISTUNGSDATUM - Das Leistungsdatum {P_Datum} ist standardmäßig immer der aktuelle Tag, ausser der Anrufer sagt explizit etwas anders. Verwende die {{current_time_Europe/Berlin}}, um den heutigen Tag zu bestimmen. - Lass den User kurz das heutige Datum bestätgen - Verwende die Systemzeit {{current_time_Europe/Berlin}}, um das Datum korrekt zu formatieren. Dabei setzen wir immer 9 Uhr als Uhrzeit. WICHTIG! Beispiel für die Formatierung: "P_Datum":"2025-07-14T09:59:19.529Z" - Niemals als Begriffe wie "heute", "gestern" etc. als Datum abspeichern
a
Thanks for the follow-up, @advisior_30841. I'll get back to you soon.
### Answer Ja, Ihre Verwendung der dynamischen Variable
{{current_time_Europe/Berlin}}
wird funktionieren [(1) ]() . Die Syntax ist korrekt für die Referenzierung von zeitzonspezifischen aktuellen Zeitvariablen [(2) ]() . Retell AI unterstützt die Verwendung von
{{current_time_[timezone]}}
in Prompts, wobei Sie die gewünschte Zeitzone angeben können [(1) ]() . In Ihrem Fall wird
{{current_time_Europe/Berlin}}
die aktuelle Zeit in der Berliner Zeitzone bereitstellen [(2) ]() . Die dynamischen Variablen können in verschiedenen Bereichen verwendet werden [(1) ]() : - Prompts - Begin messages - Tool call descriptions - Voicemail settings Ihr Beispiel-Prompt mit
{{current_time_Europe/Berlin}}
sollte ordnungsgemäß funktionieren, um das heutige Datum in der Berliner Zeitzone zu bestimmen .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Simulation Testing Now Live for All Agents](https://www.retellai.com/changelog/simulation-testing-now-live-for-all-agents-c27zh) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy i am having problems with using {{user_number}} in prompts. it is not getting recognized if used "silently". Sample prompt: Basierend auf {{user_number}} wird automatisch der korrekte User ermittelt: what could be the problem hier
a
Thanks for the follow-up, @advisior_30841. I'll get back to you soon.
### Answer The issue with
{{user_number}}
not being recognized might be related to the call type or context. According to the documentation,
{{user_number}}
is only available for phone calls and represents the user's phone number (from_number for inbound calls, to_number for outbound calls) [(1) ]() . Here are some potential issues to check: 1. **Call Type**: The
{{user_number}}
variable is only available for phone calls, not web calls . If you're testing with web calls, this variable won't be populated. 2. **Variable Not Set**: When a dynamic variable is not assigned a value, it will remain unchanged in the output . For example, if
user_number
is not set, your prompt will display as "Basierend auf {{user_number}} wird automatisch der korrekte User ermittelt:" instead of replacing the variable. 3. **Testing Environment**: Based on community discussions, there can be differences between testing in the Retell dashboard versus actual API calls [(2) ]() . Some users have reported that dynamic variables work in testing but not in live API calls. To troubleshoot: 1. Verify you're making phone calls, not web calls 2. Check your call logs to see if the
{{user_number}}
variable is being populated 3. Try a simple test prompt that explicitly mentions the variable: "The caller's number is {{user_number}}" to see if it gets replaced 4. Ensure you're using the correct API structure when making calls [(3) ]() If the variable continues to not populate, you might want to check if there are any issues with how the phone number is being passed in your call setup.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy ich brauche das Datum in diesem Format. ich bekomme aber dennoch Tool Result tool_call_id: extract_dynamic_variables_1ee536 {"P_Datum":"30.07.2025 09:00"} Der Prompt dazu: - Verwende die Systemzeit {{current_time_Europe/Berlin}}, um das Datum korrekt zu formatieren. Dabei setzen wir immer 9 Uhr als Uhrzeit. WICHTIG! Beispiel für die Formatierung: "P_Datum":"2025-07-14T09:00:00.00Z"
a
Thanks for the follow-up, @advisior_30841. I'll get back to you soon.
### Answer Das Problem liegt daran, dass die dynamische Variable
{{current_time_Europe/Berlin}}
Retell AI das aktuelle Datum und die Zeit in einem bestimmten Format bereitstellt, aber das LLM (der AI-Agent) entscheidet selbst, wie es diese Information formatiert [(1) ]() . Die
{{current_time_Europe/Berlin}}
Variable gibt die Zeit in einem Format wie "Thursday, March 28, 2024 at 11:46:04 PM CET" aus . Das LLM interpretiert dann Ihre Anweisung zur Formatierung, aber es kann trotzdem ein anderes Format wählen. Für eine präzisere Kontrolle über das Datumsformat haben Sie mehrere Optionen: 1. **Spezifischere Prompt-Anweisungen**: Verstärken Sie Ihre Formatierungsanweisungen im Prompt: - "KRITISCH: Das Datum MUSS exakt im ISO 8601 Format formatiert werden: YYYY-MM-DDTHH:MM:SS.SSZ" - "Verwende NIEMALS das Format DD.MM.YYYY - verwende IMMER YYYY-MM-DD" 2. **Extract Dynamic Variables Tool verwenden**: Das Extract Dynamic Variables Tool kann Werte in spezifischen Formaten extrahieren [(2) ]() . Sie können verschiedene Variable Types verwenden: - Text für Datumsstrings - Number für numerische Werte - Spezifische Enum Optionen für vordefinierte Formate 3. **Eigene Dynamic Variables senden**: Anstatt sich auf
{{current_time_Europe/Berlin}}
zu verlassen, können Sie Ihre eigenen dynamischen Variablen über die API senden. Bei Outbound Calls können Sie das
retell_llm_dynamic_variables
Feld verwenden [(3) ]() :
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "formatted_date": "2025-07-30T09:00:00.00Z"
  }
}
Basierend auf Community-Diskussionen haben einige Nutzer ähnliche Probleme mit Zeitformatierung berichtet [(4) ]() . Ein Workaround ist, eigene Datums- und Zeitvariablen zu senden, anstatt sich auf die Standard-Systemvariablen zu verlassen .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[4] Discord message from @gebstrategy on 2025-03-11](https://discord.com/channels/1186424376300679209/1294891368505937952/1349112741129879572) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.