Please note that SQLite 'localtime' modifier in its datetime() function relies on the OS-level localtime function. This means that the PHP function date_default_timezone_set doesn't change the timezone used by SQLite. For this you need to also set the TZ environment variable:
putenv('TZ=Pacific/Kiritimati');
If not, calling the datetime SQLite function with the 'localtime' modifier will not return the same time as the one set by date_default_timezone_set (unless they are the same of course).