Welcome Guest, Not a member yet? Register   Sign In
Time::createFromTimestamp always -2 hours in my local time
#1

Hi,

I'm using the Time class from CodeIgniter 4 to format my datetime, but for some reason the time is always -2 hours.
Checked if function app_timezone() would give correct results, that's without issues 'Europe/Amsterdam' but when using the code below it's always -2 hours.

Did I miss something with settings or am I just using it the wrong way?
PHP Code:
<?php

$created_at 
'2022-07-03 14:38:10';
$timmestamp Time::createFromTimestampstrtotime$created_at ), app_timezone() ); // Correct, Europe/Amsterdam
                        
return $timmestamp->toLocalizedString("d MMMM yyyy 'om' HH:mm");  // Always output with time:  12:38 
Reply


Messages In This Thread
Time::createFromTimestamp always -2 hours in my local time - by superior - 07-03-2022, 06:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB