Formatting Slug {postDate.month} to 2 characters We are migrating our site into Craft, which is by and far easy and pleasant. But I'm trying to match our old CMS's permalink structure, which used 2-character months in the URI.

When defining the structure to contain our old content, I'm unable to format the postDate.month as I'd like. I thought the Twig below would work, but it's giving me the wrong digit for the month (or example it should be '07' but consistently gives me '12'):

{postDate.year}/{postDate.month|date('m') }/{slug}


I'm sure this is pretty simple, but I can't pin down the syntax. Could someone please give me a hand?

I need a URI like this:

2015/07/here-is-my-slug
You should just be able to do:

postDate|date('m')


postDate by itself should give you a DateTime object which you can then apply the filter to.