Body: <p>I'm creating a template for my acknowledgement letters and would like to include today's date and the date of contribution, however both {domain.now} and {contribution.receive_date} generate text which includes the time, which is unwieldy and awkward for a mailed thank you letter.</p>
  <p>How can I remove the time from these tokens? (or re-format the date entirely?)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-24T17:07:17.440Z
Comments.Text: {domain.now|crmDate:"Full"} just spits out code instead of text in the pdf – settings->date preferences doesn't do it –– and every tutorial I see on using smarty only tells you how to install it for Joomla and Drupal. Does that mean I can't use it in wordpress?
Comments.UserDisplayName: Jon Watts
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-24T18:56:40.923Z
Comments.Text: Similar question:  https://civicrm.stackexchange.com/questions/41524/date-format-for-token-domain-now. For smarty see https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#smarty. It's the same for wordpress.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-24T23:21:25.373Z
Comments.Text: Related: https://lab.civicrm.org/dev/core/-/issues/3072
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-30T09:51:40.580Z
Comments.Text: smarty will perfectly do the job
Comments.UserDisplayName: Guillaume Sorel
Tags: <message-templates>
Title: How to customize date format in a template?
ThreadText: # How to customize date format in a template?
  
  (Asked by: username_0 on 2022-03-24)
  
  I'm creating a template for my acknowledgement letters and would like to include today's date and the date of contribution, however both {domain.now} and {contribution.receive\_date} generate text which includes the time, which is unwieldy and awkward for a mailed thank you letter.
  
  How can I remove the time from these tokens? (or re-format the date entirely?)
  
  **Tags:** message-templates
  
  > **Comments:**
  > **username_0**: {domain.now|crmDate:"Full"} just spits out code instead of text in the pdf – settings->date preferences doesn't do it –– and every tutorial I see on using smarty only tells you how to install it for Joomla and Drupal. Does that mean I can't use it in wordpress?  
  > **username_1**: Similar question:  https://civicrm.stackexchange.com/questions/41524/date-format-for-token-domain-now. For smarty see https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#smarty. It's the same for wordpress.  
  > **username_1**: Related: https://lab.civicrm.org/dev/core/-/issues/3072  
  > **username_2**: smarty will perfectly do the job  
  
  ---
  
  ## 0 answers
  
  