Clarification on Date Dynamic Content Doc

In the docs it says:

Most date value used in Dynamic Content can be formatted as date in another format. Use type="date in your Dynamic content, then with the format property you can display the date format you are looking for. See the example below. Format uses PHP date formatting internally, see PHP format characters. Internally this uses strtotime, you can pass values like Monday next week and it will work dynamically.

{{dc:looper:field key="created_date" type="date" format="Y m d"}}

I’ve bolded the part that I don’t understand. The way it is phrased, it sounds like I could modify the dynamic content key by using a phrase like “monday next week” but there’s no example of the correct use. It says I can pass a value, but not how. It’s likely I don’t understand what “internally” means as it’s used here, and there is no keyword modification that can be done with dynamic content dates. (Only using core cornerstone DC, that is, not twig.)

For context, I was looking into this because I’d like to use {{dc:global:date}} and subtract or add 1 year so I can build queries to fetch last year, this year and next year without manually setting last year and next year, and the date key I’m using is stored as a meta value rather than the publication or modification date.

I know historically there were limitations to how dynamic dates are handled, but there have been so many very cool advances lately! and the docs don’t always keep up. (it happens!)

So is there a way to use strtotime rules to tell Global Date to use any time but right now?

I added a sample generic date usage to the docs.

If you’re talking about a random date, you could do something like this in Twig. If you use the Dynamic Content UI under “Random” you could grab a random number range you are looking for. Have a great day.

{{ date('+' ~ random.integer ~ ' days') | date('m/d/y') }}

Oh nice. Could you link to that? This page doesn’t look different to me: https://theme.co/docs/dynamic-content so maybe I’m looking in the wrong spot.

I was mostly thinking like {{dc:global:date strtotime="-1 Year" format=“Y”}} {{dc:global:date strtotime="+1 Year" format=“Y”}} or something. To get today plus or minus strtotime phrasing. Because that would be massively helpful.

This might be what you’re looking for: https://theme.co/docs/twig > Dates section.
This documentation might also help: https://theme.co/docs/twig-api

Let us know if you need more info.

Also here https://theme.co/docs/date-dynamic-content

Date dynamic content is exactly what i was looking for thanks so much.

You are most welcome, @GL_creative.