https://retellai.com/?utm_source=discord&utm_medium=seo logo
Trying to get my greeting to be dynamic with a sim...
# ❓・ai-evy-support
c
@AI Evy Trying to get my greeting to be dynamic with a simple "Good Morning.. etc" or "Good Afternoon.. etc" beginning based on the current time PST.
a
Thanks for tagging me @Codyx. I'll look through relevant sources and get back to you shortly.
### Answer You can achieve this using the
{{current_time_America/Los_Angeles}}
system variable, which gives you the current time in PST/PDT. [(1) ]() In your prompt or begin message, you can add conditional logic like:
Copy code
If the time in {{current_time_America/Los_Angeles}} is before 12:00 PM, greet with "Good morning."
If the time is between 12:00 PM and 5:00 PM, greet with "Good afternoon."
Otherwise, greet with "Good evening."
The
{{current_time_[timezone]}}
variable returns the current time in a format like "Thursday, March 28, 2024 at 11:46:04 PM PST", so the LLM can parse the hour and determine the appropriate greeting. You can place this logic directly in your agent's prompt and reference the variable in your begin message or greeting instructions.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the feedback, glad I was helpful.