Reformat date from CURRENT_TIMESTAMP - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Reformat date from CURRENT_TIMESTAMP (/showthread.php?tid=75571) Pages:
1
2
|
RE: Reformat date from CURRENT_TIMESTAMP - John_Betong - 02-24-2020 (02-24-2020, 08:29 AM)MikiStoni Wrote:(02-23-2020, 09:47 PM)John_Betong Wrote: @MikiStoni, I assumed that the $timestamp variable was an actual UNIX timestamp (integer seconds since 1970...) and not a string. Please try the following: Code: var_dump($timestamp); Perhaps renaming $timestamp to $datetime would be easier for others when the variable types are not declared in the function parameters. Reminds me of calling apples oranges and vice-versa RE: Reformat date from CURRENT_TIMESTAMP - MikiStoni - 02-26-2020 Hi zahhar doesn't work for me. My Controll Code: helper('changetable'); My Profile Code: {changetable} My Helper Code: if (!function_exists('changetable_get')) { Result: Code: {changetable} {/changetable} funny thing RE: Reformat date from CURRENT_TIMESTAMP - zahhar - 02-26-2020 (02-26-2020, 04:08 AM)MikiStoni Wrote: Hi zahhar MikiStoni, this is how you could proceed: 1) ensure you have changes in system/View/Parser.php class as proposed here: https://github.com/codeigniter4/CodeIgniter4/pull/2603/files 2) take my example and ensure it works for you. You should start wikth smth really simple. Regarding your code: it most probably would not work. In order to work, you should populate {changetable} variable with array of arrays. You can try the following: try to supply static data into changetable variable in your $data array first, like this: PHP Code: 'changetable' => [ Then show what you get. RE: Reformat date from CURRENT_TIMESTAMP - MikiStoni - 02-29-2020 You're right. If I input that directly, it works. with the further use of the class i found out that no provided filter works for me if a bracket belongs to it. work: Code: <td>{ message|prose }</td> does not work: Code: <td>{ message|limit_chars(100) }</td> does anyone know the problem? |