# Handling Date in action

**URL:** https://forum.rasa.com/t/handling-date-in-action/37392
**Category:** Rasa Open Source
**Created:** [November 25, 2020, 1:11pm UTC](https://forum.rasa.com/t/handling-date-in-action/37392 "2020-11-25T13:11:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![manoj\_kumar](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@manoj\_kumar](https://forum.rasa.com/u/manoj_kumar)
#### Post date: [November 25, 2020, 1:11pm UTC](https://forum.rasa.com/t/handling-date-in-action/37392/1 "2020-11-25T13:11:50Z")

</div>

```
async def validate_time(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Dict[Text, Any]:
    """Validates value of 'time' slot"""
    timeentity = get_entity_details(tracker, "time")
    parsedtime = timeentity and parse_duckling_time(timeentity)
    if not parsedtime:
        dispatcher.utter_message(template="utter_no_transactdate")
        return {"time": None}
    return parsedtime

```

Can I apply a logic to it that “if date is less than today” should throw an error that invalid date or time Can any one help out on this

Thanks in advance.

---

<div class="post-metadata">

### Author: ![jjuzl](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jjuzl](https://forum.rasa.com/u/jjuzl)
#### Post date: [December 2, 2020, 12:43pm UTC](https://forum.rasa.com/t/handling-date-in-action/37392/2 "2020-12-02T12:43:02Z")

</div>

Hi @manoj_kumar,

You can use any python code to validate the slot value and then use `dispatcher.utter_message` like in your example to send a message to the user.

---

<div class="post-metadata">

### Author: ![manoj\_kumar](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@manoj\_kumar](https://forum.rasa.com/u/manoj_kumar)
#### Post date: [December 2, 2020, 12:50pm UTC](https://forum.rasa.com/t/handling-date-in-action/37392/3 "2020-12-02T12:50:20Z")

</div>

Hi @jjuzl,

Thanks for the reply.

And I tried applying a logic that if the date is less than today and gave dispatcher.utter\_message(“Invalid Date”). But, it was taking any date and scheduling the payment

 ![Screenshot (196)](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/0b8e17429630ec4293abbdcec6c2c54f7247c539.png)[https://github.com/RasaHQ/financial-demo/tree/rasa-2-0](https://github.com/RasaHQ/financial-demo/tree/rasa-2-0) Could you explain me the process step-by-step please?

Thanks
