Jump to content

Convert the date format (Variable Available in WHMCS) in the Email template


Recommended Posts

Hi,

At the level of the configuration of the Email template, WHMCS proposes Variables Available when designing your email templates.

Among these variables, there is {$ invoice_date_created} which returns as the date of creation of an invoice but the format of the date is in English "Wednesday, July 4th, 2018"

If I want to change this format and I convert it date as 04/07/2018, how can I do it? Is there a tag or formula that allows me to change the date with this format DD / MM / YY ?


Thank you in advance.

Link to comment
Share on other sites

20 hours ago, Rabab said:

If I want to change this format and I convert it date as 04/07/2018, how can I do it?

the variable is using the Client Date Format specified in setup -> general settings -> localisation...

KGIrsQR.png

so if you set the global date format to whatever is appropriate and then set CDF to use it, then WHMCS will use that format for that variable.

the other way, if you just want to adjust this variable in the email template, would be to use...

{$invoice_date_created|date_format:"%d/%m/%Y"}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated