Page 1 of 1

Date column shows wrong time

Posted: Thu May 08, 2025 9:22 am
by nadir
I have the following Php code in BB section of browse only form:

Code: Select all

//$currentDate = date("YYYY-MM-DD");

$currentDate = "#date_filter#";

$select = "

    SELECT

    (FROM_UNIXTIME(scores.timestamp)) as test_date,
    scores.*,
    users.*,
    procedures.*

    FROM
        scores
            JOIN users ON scores.user_id = users.users_id
            JOIN procedures ON scores.procedure_id = procedures.procedures_id

    WHERE DATE(FROM_UNIXTIME(`timestamp`)) = '$currentDate'";

nuCreateTableFromSelect('#TABLE_ID#', $select);
In PhpMyAdmin, the query runs correctly and the test_date column shows date according to current time zone.

But in the browser, the column shows incorrect time. Please see attached screenshots:
Screenshot 2025-05-08 122006.png
Screenshot 2025-05-08 122030.png

Re: Date column shows wrong time

Posted: Thu May 08, 2025 4:14 pm
by kev1n
Hi,

It could be due to the time zone setting (Setup -> Settings)

Re: Date column shows wrong time

Posted: Fri May 09, 2025 7:02 am
by nadir
Yes, that was causing the issue. I set the time zone under Setup and that fixed the issue. Thanks