Display a custom date in 5.8

Dear community!

I am trying to display a date (from the datepicker) on a page in my first 5.8-installation like I did it a hundred times before in 5.7:

echo strftime( "<h1>%d.%m.%Y</h1>", strtotime($c->getAttribute( 'beginn' )) );

This results: “strtotime() expects parameter 1 to be string, object given”.

BUT:

echo strftime( "<h1>%d.%m.%Y</h1>", strtotime($c->getCollectionDatePublic)) );

works like usual.

So what is the difference between the datePublic and a custom date?

Thanks in advance

Mathias

Got it!!!

<?php $date = $c-> getAttribute( 'beginn' ); echo date_format($date, 'd.m.Y'); ?>

Add the attribute to a variable and then var_dumb() it to see what it’s outputting

Thank you so much, but I solved it already by using another code:

<?php $date = $c-> getAttribute( 'beginn' ); echo date_format($date, 'd.m.Y'); ?>

That’s it. :wink: