Incorrect Time

Issue #110 resolved
Kiat Siong Ng created an issue

I set the timezone to Asia / Singapore: Untitled.png

But the display time is not local time:Untitled.png

Comments (9)

  1. Kiat Siong Ng reporter

    As reference, I output date('c') in Sellvana and Magento, both with the same timezone in config:

    Sellvana: string(25) "2017-06-13T08:32:41-07:00"
    Magento: string(25) "2017-06-13T15:32:56+00:00"
    
  2. Kiat Siong Ng reporter

    Thanks for the fast fix. However, the AM/PM bit is reversed, when displayed as AM, it should be PM.
    Untitled.png
    I have confirmed by adding another new customer, the AM/PM bit is reversed.

    Note that I test in a shared hosting environment, where git is not supported (composer is), I FTP the files in commit 2d7dc8e. I hope those files were the necessary files for the fix.

  3. Boris Gurvich

    Could you please try to log out and login to the Sellvana admin? I've just tried Asia/Singapore and it worked well, see the screenshot (Updated time for Product 1).

    chrome_2017-06-13_18-48-10.png

  4. Boris Gurvich

    Regarding composer - I'm trying to avoid requiring tools that are not necessary, or command line in general, even though there's CLI tool available.

    I've started a new vue.js admin panel - /admin-spa - it is not functional yet, but I'm curious about your opinion of the direction.

    Thanks.

  5. Kiat Siong Ng reporter

    Login and log out of the admin yielded the same results as before, AM/PM is reversed. I also created a product, even though it's afternoon now, it shows 3:34:14 AM. For reference:

    Sellvana:

    $var[] = date('c');
    $var[] = date_default_timezone_get();
    return $this->BDebug->vardump($var, $this);
    

    The above returns:

    array(2) {
      [0] => string(25) "2017-06-14T03:51:37-04:00"
      [1] => string(16) "America/New_York"
    }
    

    Magento:

    $result[] = date('c');
    $result[] = date_default_timezone_get(); 
    $dt = microtime(true) - $t2;
    Mage::helper('clog')->_echo($result, "Done in $dt secs");
    

    This returns

    Done in 5.3882598876953E-5 secs
     array(2) {
      [0] => string(25) "2017-06-14T07:51:45+00:00"
      [1] => string(3) "UTC"
    }
    

    where clog is my custom module in Sellvana and Magento.

    Untitled.png

    That explains the AM/PM switch. So where did it go wrong?

    [edit]
    I found the problem, it's the tz field in the table fcom_admin_user, which is set to America/New_York. After I changed to Asia/Singapore in the table, the time now displayed correctly.

  6. Kiat Siong Ng reporter

    Every admin can use a SPA treatment anytime. I think the direction to use vue.js is great! Yes, Yes, Yes!

  7. Log in to comment