Kirby messes with "time"

When I use

<?php echo date( 'Y-m-d H:i', time() ); ?>

from within a template, the time is 2 hours earlier.
When I call the same function from a static php file on the same server I get the time as expected.

How is this possible and how do I fix this?

FYI: I’ve tried this on the starterkit as well and it is also “wrong” there.


Have you set the timezone in your config.php?


Well that was easy. I should ask stuff earlier here :stuck_out_tongue:

Danke Shön, @texnixe !

1 Like

does that config setting change all calls of php date function using date-default-timezone-set? so if i set the config and call date() in like my controller will it use that timezone?

Yes, it sets the timezone for all date functions: