This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Changing the date format


  1. takemura
    Member

    I've noticed that dates used in the view_entry.php, and in the emails when I used the template variable {date_created, are in the Japanese format i.e. year first.

    How can I change this globally so that all date formats in my admin screen and in emails generated are in the UK format, i.e. DD/MM/YYYY

    Also, in the emails screen I wanted to add the date to the email notifications so I entered the template variable in the 'content' box as follows:

    {entry_data}
    {date_created}

    But, the entry data is nicely formatted in columns with zebra striping but the date isn't formatted in the same way. Again, how can I make it so it's formatted in the same way as the entry data?

    Posted 13 years ago #
  2. redityo

    You can edit "helper-functions.php" file to change "date_created" format. Go to line 307 and you'll see this code :

    $template_values[$i]	= $date_created;

    then change the code with this

    $template_values[$i]	= date("d/m/Y",strtotime($date_created));

    And to give a style into "date_created" field, the easiest way is define the style in mail "content" box it self. For example like this :

    {entry_data}
    <div style="border-bottom:1px solid #DEDEDE;padding:5px 10px;background-color:#F3F7FB;margin-top:-10px"> {date_created}</div>

    MachForm Support

    Posted 13 years ago #

RSS feed for this topic

Reply