# How to write current time comparing domain for xml

**URL:** https://discuss.tryton.org/t/how-to-write-current-time-comparing-domain-for-xml/3643
**Category:** Developer
**Created:** [January 5, 2021, 6:29am UTC](https://discuss.tryton.org/t/how-to-write-current-time-comparing-domain-for-xml/3643 "2021-01-05T06:29:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![athelia](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@athelia](https://discuss.tryton.org/u/athelia)
#### Post date: [January 5, 2021, 6:29am UTC](https://discuss.tryton.org/t/how-to-write-current-time-comparing-domain-for-xml/3643/1 "2021-01-05T06:29:53Z")

</div>

Hi,

I have some records, for example:

> Venue, Start date, End date  
> Meeting Room A, 5/1/2021 10:00:00, 5/1/2021 12:00:00  
> Meeting Room B, 5/1/2021 11:00:00, 5/1/2021 12:00:00

If current time is 5/1/2021 10:30:00, I want to display only Meeting Room A in the tree view.

Something like this  
`<field name="domain" eval="[(*current_datetime*, '<', 'end_date' )]" pyson="1"/>`

May I know how to write the current\_datetime in XML domain for this case? Thank you.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [January 5, 2021, 9:19am UTC](https://discuss.tryton.org/t/how-to-write-current-time-comparing-domain-for-xml/3643/2 "2021-01-05T09:19:29Z")

</div>

You must use a PYSON expression with [DateTime](https://docs.tryton.org/projects/server/en/latest/ref/pyson.html#trytond.pyson.DateTime) like: `[('end_date', '>=', DateTime())]`.

---

<div class="post-metadata">

### Author: ![athelia](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@athelia](https://discuss.tryton.org/u/athelia)
#### Post date: [January 5, 2021, 9:41am UTC](https://discuss.tryton.org/t/how-to-write-current-time-comparing-domain-for-xml/3643/3 "2021-01-05T09:41:58Z")

</div>

Thank you, it works 😃

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [February 4, 2021, 9:41am UTC](https://discuss.tryton.org/t/how-to-write-current-time-comparing-domain-for-xml/3643/4 "2021-02-04T09:41:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
