Registered user date is not showing correctly on 2 pages

Discussion in 'General Support' started by david62311, Oct 12, 2020.

  1. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,149
    Likes Received:
    247
    I don't know if anybody else is seeing it but, I saw on my item.php page
    • Member since 10/11/2020

    In my profile.php page :
    • Registered user since...Shows: Jan 01, 1970
    In the database under webid_users my reg_date shows:
    1375794060 which equals:
    GMT: Tuesday, August 6, 2013 1:01:00 PM

    You can search online for the epochconverter to convert that date.

    It's weird that I am getting one currenct date and one old date. I think the old date of 1970 was an old bug we had a long time ago. There might be a fix somewhere in the forum about the 1970 date correction. I will take a look.

    I am not sure why the other date is coming up current but, I do it's not using SELECT correctly for the reg_date in the webid_users database table.
     
  2. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,149
    Likes Received:
    247
    I got the one working for the profile.php page.

    On profile.php page find around line 88:
    PHP:
        $DATE strtotime($user_data['reg_date']);
    Change to:
    PHP:
        $DATE = ($user_data['reg_date']);
    I removed the strtotime and it shows my correct join date now:
    Registered user since: Aug 06, 2013

    strtotime is supposed to convert the unix time to be readable by humans. It's strange before I removed it, that it showed the 1970 date. Maybe the conversion is already coded to make the date readably by humans before the strtotime is added to the code. I am taking a closer look at it. I want to understand the coding a little more.
     
    Last edited: Oct 12, 2020
  3. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,149
    Likes Received:
    247
    In the profile.php page we got at least on my page it's line 88 and below:

    PHP:
        $DATE strtotime($user_data['reg_date']);
        
    $mth 'MON_0'.date('m'$DATE);
    Then around line 116 we got this:
    PHP:
            'REGSINCE' => $MSG[$mth] . ' ' date('d, Y'$DATE),
    Notice around line 15 we got the include:
    PHP:
    include 'common.php';
    In the common.php around line 39 we got this that includes the functions_global.php page:
    PHP:
    include $include_path 'functions_global.php';
    All of these pages have coding that's connected. Probably this coding somewhere around line 408 already converts the unix time so, the strtotime is most likely not needed in the coding I mention in the post before..
    PHP:
        // Display current Date/Time
        
    $mth 'MON_0' date('m'$system->ctime);
        
    $date $MSG[$mth] . date(' j, Y'$system->ctime);
        
    $counters .= $date ' <span id="servertime">' date('H:i:s'$system->ctime) . '</span>';
        return 
    $counters;
     
  4. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,149
    Likes Received:
    247
    I tried to get the time for the item.php page working tonight but, I couldn't figure it out tonight. I will try to look at this later but, you guys feel free to have a go at it and see if you can get it to work. Just a warning thought: Changing the code with the wrong code on the item.php page can cause a blank page with errors. The item.php page is a very touchy page with code changes.

    The line of code I was looking at on the item.php page was this one around line 52:
    PHP:
    $seller_reg $dt->formatDate($auction_data['reg_date']);
    For some reason the current tdate comes up when I look at it. Mine says this:
    • Member since 10/11/2020


    The connection for the users table is just above that code looks ok:

    PHP:
    // get auction all needed data
    $query "SELECT a.*, ac.counter, u.nick, u.reg_date, u.city, u.country, u.zip FROM " $DBPrefix "auctions a
                LEFT JOIN " 
    $DBPrefix "users u ON (u.id = a.user)
                LEFT JOIN " 
    $DBPrefix "auccounter ac ON (ac.auction_id = a.id)
                WHERE a.id = :auction_id LIMIT 1"
    ;
    @pani100 was always the time expert coder here.
     

Share This Page