How to format a Date field in Table view

Fredolino 1d ago

Why doesn't the date format work anymore?

It was so easy in CF7. But it doesn't work in CF8. The result I'm getting is awful.

{date:d.m.Y$(var:Main.registerDate)} gives the result:

28.10.2025$(355amTue, 28 Oct 2025 11:31:48 +0000:Octam3110.Tue, 28 Oct 2025 11:31:48 +0000UTC11314831UTCTue, 28 Oct 2025 11:31:48 +0000Tueam31UTC)

If I enter this in the text node, I get the correct format, but always only the current date.{date:d.m.Y} --> 28.10.2025

F.

Max_admin 1d ago
Answer

in v8 it should be in this format:

{date:d.m.Y={var:Main.registerDate}}

But the inner tag should supply a timestamp

You can also run a PHP action and process the variable using strtotime then return the format you need

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fredolino 1d ago

mh...but i see only the current date 28.10.2025

Max_admin 1d ago

Yes, but does {var:Main.registerDate} return a timestamp ?

As I said you better just use PHP:

echo date('d.m.Y', strtotime($this->get("Main.registerDate")));
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fredolino 1d ago

Can I insert PHP into a text node? No.

And when I insert your code into PHP and then into the table row, unfortunately I only get 01.01.1970.

Max_admin 1d ago

Inside a table the values are under "row", so you will need to use this code:

echo date('d.m.Y', strtotime($this->get("row.Main.registerDate")));

Just use a PHP action and the "echo" will print the result, or return the result and use it in a Text node

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fredolino 21h ago

I still don't understand what you mean. I'm still getting 01/01/1970.

Screenshot.png
Max_admin 21h ago

in your PHP use this:

return $this->get("row.Main.registerDate");

now what do you get ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fredolino 21h ago

If I do it this way, I only get an empty column in the table.

If I retrieve the data from read_data without formatting, then I get this result:2024-06-30 12:03:47 which was so easy to reformat with CF 7.

Screenshot.png
Max_admin 21h ago
1 Likes

I found the issue, your table row has values under strings with a ".", like: Main.registerDate, so the format we used does not work

This code should work:

echo date('d.m.Y', strtotime($this->get("row")["Main.registerDate"]));
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fredolino 20h ago

Wow! That just solved the problem!

Thank you so much for your help!

Make this in PHP:

echo date('d.m.Y', strtotime($this->get("row")["Main.registerDate"]));

and call the PHP code within the text node.

In CF7, I only had to use one text node. So it has become a bit more complicated...

F.

Max_admin 19h ago
1 Likes

Great, PHP gives you more control, and it's just one line of code.

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fredolino 19h ago

I have found that it is also possible to insert only the PHP action into the table row, without calling the PHP within a text node. :-)

Max_admin 16h ago

yes, with "echo" in PHP you do not need the Text node!

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.