Answers.Body: <p>You're close! For the month part you need <code>postDate|date("m")</code> (<a href="http://php.net/manual/en/function.date.php">this page</a> has the php date formats).</p>
  
  <pre><code>news/{postDate|date("Y")}/{postDate|date("m")}/{slug}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-13T06:22:57.613Z
Answers.Text: Correct me if I'm wrong, but wouldn't this also work? `news/{postDate|date("Y/m")}/{slug}`  ... You'd put the slash inside the date format, so it won't have to parse `postDate` twice.
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-13T15:06:58.610Z
Answers.Text: Thanks Marion, that worked great. Lindsey's suggestion worked too, thanks.
Answers.UserDisplayName: Stephen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-13T21:59:56.103Z
Answers.Text: @Lindsey Hadn't thought of that, but nice improvement.
Answers.UserDisplayName: Marion Newlevant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-13T03:45:21.783Z
Answers.LastActivityDate: 2015-06-13T03:45:21.783Z
Answers.UserDisplayName: Marion Newlevant
Body: <p>I'd like to make the Entry URL format of a channel look like this: /news/2015/06/my-slug-here</p>
  
  <p>What would I need to enter into the Entry URL Format field in order to do this?</p>
  
  <p>The closest I could manage was this:</p>
  
  <pre><code>news/{postDate|date("Y")}/{slug}
  </code></pre>
  
  <p>But that only outputs this: /news/2015/my-slug-here</p>
  
  <p>Thanks for any help.</p>
  
Tags: <url><entry><slug>
Title: How to add year and month to Entry URL Format
ThreadText: # How to add year and month to Entry URL Format
  
  (Asked by: username_0 on 2015-06-13)
  
  I'd like to make the Entry URL format of a channel look like this: /news/2015/06/my-slug-here
  
  What would I need to enter into the Entry URL Format field in order to do this?
  
  The closest I could manage was this:
  
  ```
  news/{postDate|date("Y")}/{slug}
  
  ```
  
  But that only outputs this: /news/2015/my-slug-here
  
  Thanks for any help.
  
  **Tags:** url, entry, slug
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-13. Score: 9 | Accepted answer
  
  You're close! For the month part you need `postDate|date("m")` ([this page](http://php.net/manual/en/function.date.php) has the php date formats).
  
  ```
  news/{postDate|date("Y")}/{postDate|date("m")}/{slug}
  
  ```
  
  > **Comments:**
  > **username_2**: Correct me if I'm wrong, but wouldn't this also work? `news/{postDate|date("Y/m")}/{slug}`  ... You'd put the slash inside the date format, so it won't have to parse `postDate` twice.  
  > **username_0**: Thanks username_1, that worked great. username_2's suggestion worked too, thanks.  
  > **username_1**: @username_2 Hadn't thought of that, but nice improvement.  
  
  ---
  
  