# Using relative times/dates in dynamic content

**URL:** <https://forum.mautic.org/t/using-relative-times-dates-in-dynamic-content/14524>\
**Category:** Product Support\
**Created:** [May 27, 2020, 11:41am UTC](https://forum.mautic.org/t/using-relative-times-dates-in-dynamic-content/14524 "2020-05-27T11:41:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![backseat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/backseat/32/1863_2.png) [@backseat](https://forum.mautic.org/u/backseat)\
**Post date:** [May 27, 2020, 11:41am UTC](https://forum.mautic.org/t/using-relative-times-dates-in-dynamic-content/14524/1 "2020-05-27T11:41:21Z")

</div>

**Your software**  
My Mautic version is: 2.16.2  
My PHP version is: 7.3.14

**Your problem**  
My problem is: I’d like to use dynamic content in mail with a filter similar to:

```
Date added greater than "7 days ago"

```

According to the [PHP documentation](https://www.php.net/manual/en/datetime.formats.relative.php), the string “7 days ago” should be valid. However, I get an error:

```
[2020-05-27 12:32:51] mautic.CRITICAL: Uncaught PHP Exception Exception: "DateTime::__construct(): Failed to parse time string (&quot;7 days ago&quot;) at pos
ition 0 (&quot;): Unexpected character" at /var/www/ems/app/bundles/EmailBundle/EventListener/MatchFilterForLeadTrait.php line 88 {"exception":"[object] (Exce
ption(code: 0): DateTime::__construct(): Failed to parse time string (&quot;7 days ago&quot;) at position 0 (&quot;): Unexpected character at /var/www/ems/app
/bundles/EmailBundle/EventListener/MatchFilterForLeadTrait.php:88)"} []

```

It looks to me as if the quotes are being escaped which is confusing PHP.

Is there a way of using relative times in dynamic content?
