Display and filter timestamp in client timezone

QuestionsDisplay and filter timestamp in client timezone
Kelvin asked 3 years ago

Dear Sir/Madam,

My database is located in US server with timezone GMT-8, my client is located in HK with timezone GMT+8, I setup the grid setting related to the field timestamp as below

$g->select_command = "SELECT recID, name, contact, email, gender, age, ticket, address, referrer, TIMESTAMP +INTERVAL 16 HOUR AS timestamp FROM quf_reg";

$col = array();
$col["name"] = 'timestamp';
$col["title"] = "Register Time";
$col["export"] = true;
$cols[] = $col;

The timestamp is correctly display in client's timezone, but when entering the time in filter, the rows are filtered according to the server's timezone.

How can I filter the result using client's timezone?

Best regards,


1 Answers
Abu Ghufran answered 3 years ago

You need to set dbname property with the functions used in sql query.
$col["dbname"] = "…..";

Replace ….. with exact sql expression used as alias.

Your Answer

1 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!