<p>If you go to the Commerce documentation for each (<a href="https://craftcommerce.com/docs/configuration#cartcookieduration" rel="nofollow noreferrer">https://craftcommerce.com/docs/configuration#cartcookieduration</a> and <a href="https://craftcommerce.com/docs/configuration#purgeinactivecartsduration" rel="nofollow noreferrer">https://craftcommerce.com/docs/configuration#purgeinactivecartsduration</a>), they both link to the PHP <a href="http://www.php.net/manual/en/dateinterval.construct.php" rel="nofollow noreferrer">DateInterval</a> class page that describes the various time formats you can use.</p>

<p>For 24 hours, either <code>P24H</code> or <code>P1D</code> should do it.</p>

CC BY-SA 3.0
2017-01-16T23:40:59.243Z
2017-01-16T23:40:59.243Z
Brad Bell
<p>How do I set the cartCookieDuration and purgeInactiveCartsDuration for only 24 hours?</p>

<plugin-craftcommerce>
cartCookieDuration and purgeInactiveCartsDuration config settings
# cartCookieDuration and purgeInactiveCartsDuration config settings

(Asked by: username_0 on 2017-01-16)

How do I set the cartCookieDuration and purgeInactiveCartsDuration for only 24 hours?

**Tags:** plugin-craftcommerce


---

## 1 answers

### Answer by username_1 on 2017-01-16. Score: 0 | Accepted answer

If you go to the Commerce documentation for each (<https://craftcommerce.com/docs/configuration#cartcookieduration> and <https://craftcommerce.com/docs/configuration#purgeinactivecartsduration>), they both link to the PHP [DateInterval](http://www.php.net/manual/en/dateinterval.construct.php) class page that describes the various time formats you can use.

For 24 hours, either `P24H` or `P1D` should do it.


---

