Jump to content
hanstavo

Wrong date format

Recommended Posts

Im in whmcs 4.6 and when using the {$date} I have date format set to Monday January 1st, 2018 but it comes out as 

Monday 1st January 2018

Share this post


Link to post
Share on other sites
On 22/10/2018 at 16:28, hanstavo said:

Im in whmcs 4.6

i'm going to assume you mean v7.6 🙂

On 22/10/2018 at 16:28, hanstavo said:

when using the {$date} I have date format set to Monday January 1st, 2018 but it comes out as Monday 1st January 2018 

where are you seeing this? off-hand, I know {$date} is used in viewinvoice.tpl (Tuesday, October 23rd, 2018) and the email templates (Tuesday, 23rd October 2018) - you could argue that the output inconsistency between them is a bug, but either could be fixed in the template if necessary.

e.g in the email template, changing {$date} to the code below would change the format to Tuesday, October 23rd, 2018

{$date|date_format:'l, dS F, Y'}

Share this post


Link to post
Share on other sites
8 hours ago, brian! said:

i'm going to assume you mean v7.6 🙂

where are you seeing this? off-hand, I know {$date} is used in viewinvoice.tpl (Tuesday, October 23rd, 2018) and the email templates (Tuesday, 23rd October 2018) - you could argue that the output inconsistency between them is a bug, but either could be fixed in the template if necessary.

e.g in the email template, changing {$date} to the code below would change the format to Tuesday, October 23rd, 2018


{$date|date_format:'l, dS F, Y'}

Thank You! And yes I did mean v7.6 sorry.

Share this post


Link to post
Share on other sites
19 hours ago, brian! said:

 


{$date|date_format:'l, dS F, Y'}

That doesn’t work, it just makes the whole email template disappear and send it in plain text... It might help to note that 1) I am using version 6.4 not 7.4, and that I am using the main email header (In general settings) Also is the a {smarty.now|date_format} That can use this date format as smarty.now for yours isnt working.

Share this post


Link to post
Share on other sites
19 hours ago, brian! said:

 


{$date|date_format:'l, dS F, Y'}

That doesn’t work, it just makes the whole email template disappear and send it in plain text... It might help to note that 1) I am using version 6.4 not 7.4, and that I am using the main email header (In general settings) Also is the a {smarty.now|date_format} That can use this date format as smarty.now for yours isnt working.

 

 

I solved it with:

{php} echo date("l, F dS, Y", time()); {/php}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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