https://retellai.com/?utm_source=discord&utm_medium=seo logo
I keep getting this error when try to book a meeti...
# ❓・ai-evy-support
u
@AI Evy I keep getting this error when try to book a meeting. {"error":"Time range is in the past"}
a
Thanks for tagging me @.navigator. I'll look through relevant sources and get back to you shortly.
### Answer This error typically occurs if the time being sent to the booking function is interpreted as being in the past, even if it looks correct to you [(1) ]() , [(2) ]() . This can happen due to time zone mismatches or the way relative dates (like "today") are resolved. To address this: - Always ensure both your Retell agent and your calendar integration (e.g., cal.com) are set to the same time zone . - When handling relative dates like "today", use the current time variable (e.g., {{current_time_Pacific/Auckland}}) and always convert dates to strict ISO 8601 format before making the booking call . - Make sure your prompts or logic resolve all relative date expressions (like “today”, “tomorrow”) using the agent's current time as a reference . If the issue persists, try simplifying your prompt to avoid conflicting instructions, or handle date logic server-side for more consistency .
​ To learn more, see the sources I considered: [[1] Hello, i have issues with the book appointment function.](https://discord.com/channels/1186424376300679209/1366220119847473172) [[2] Can't book time for today](https://discord.com/channels/1186424376300679209/1386796321406582885) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
u
@AI Evy I still get an error when I put {{current_time_America/New_York}}. The time,one in Cal.com and Retell both match but it still is off by 1 day
a
Thanks for the follow-up, @.navigator. I'll get back to you soon.
### Answer The variable {{current_time_America/New_York}} will return the current time in the America/New_York timezone, but the result is a string like “Thursday, March 28, 2024 at 11:46:04 PM EDT” [(1) ]() [(2) ]() [(3) ]() [(4) ]() . This is not an ISO 8601 timestamp, and Cal.com expects times in strict ISO 8601 format for bookings [(5) ]() . If you pass the formatted string directly, it may be misinterpreted or shifted by a day, especially if the string is parsed differently by Cal.com or by any step in your workflow . To resolve this: - Ensure your logic or prompt converts {{current_time_America/New_York}} to an ISO 8601 string before making the booking API call. You may need to use an intermediate step or tool to handle this transformation, as Retell dynamic variables themselves return formatted strings, not ISO timestamps [(1) ]() [(5) ]() . - Double-check that both your agent and Cal.com are using the same timezone, and that you are not introducing a date shift during formatting or parsing [(5) ]() . If you need to extract and format the variable into ISO 8601, consider doing this in your function/tool logic before sending the booking request .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[3] Simulation Testing Now Live for All Agents](https://www.retellai.com/changelog/simulation-testing-now-live-for-all-agents-c27zh) [[4] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[5] Cal.com Booking Fails from Retell Voice Agent (Live Call) due to API Receiving Incorrect Data](https://discord.com/channels/1186424376300679209/1415172353498943549) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.