Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Date column shows wrong time Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
nadir
Posts: 39
Joined: Mon Apr 21, 2025 7:03 am
Has thanked: 4 times
Been thanked: 4 times

Date column shows wrong time

Unread post 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
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Date column shows wrong time

Unread post by kev1n »

Hi,

It could be due to the time zone setting (Setup -> Settings)
nadir
Posts: 39
Joined: Mon Apr 21, 2025 7:03 am
Has thanked: 4 times
Been thanked: 4 times

Re: Date column shows wrong time

Unread post by nadir »

Yes, that was causing the issue. I set the time zone under Setup and that fixed the issue. Thanks
Post Reply