Message: DateTime::setTimestamp() expects parameter 1 to be integer, float given

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Message: DateTime::setTimestamp() expects parameter 1 to be integer, float given

      Hello,

      when i try to cancel some items in the queue of research lab or buildings i have this error:





      Message: DateTime::setTimestamp() expects parameter 1 to be integer, float given
      File: /includes/GeneralFunctions.php
      Line: 143
      URL: spacewarlords.com/game.php?page=buildings
      PHP-Version: 7.2.10-0ubuntu0.18.04.1
      PHP-API: apache2handler
      2Moons Version: 2.0.git
      Debug Backtrace:
      #0 [internal function]: errorHandler(2, 'DateTime::setTi...', '/i...', 143, Array)
      #1 /includes/GeneralFunctions.php(143): DateTime->setTimestamp(INF)
      #2 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', INF, 'Europe/Berlin')
      #3 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
      #4 /game.php(57): ShowBuildingsPage->show()
      #5 {main}


      someone know how i can fix it ?
    • Hello,

      What is the value of INF as its not a variable ... ? its seems to be a constant ?
    • seems to me a DB error, or that the action of cancellation of the construction provides a value of a format different from that of the DB, but I'm not sure
    • i have the same error

      Source Code

      1. [19-Nov-2018 18:10:49] WARNING: "DateTime::setTimestamp() expects parameter 1 to be integer, float given"
      2. File: /var/www/virtual/..../htdocs/includes/GeneralFunctions.php | Line: 143
      3. URL: https://2worlds.club/uni3/game.php?page=buildings | Version: 2.0.git
      4. Stack trace:
      5. #0 [internal function]: errorHandler(2, 'DateTime::setTi...', '/var/www/virtual/..../htdocs/includes/GeneralFunctions.php', 143, Array)
      6. #1 /includes/GeneralFunctions.php(143): DateTime->setTimestamp(1.7313943249827E+87)
      7. #2 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 1.7313943249827E+87, 'Europe/Berlin')
      8. #3 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
      9. #4 /game.php(57): ShowBuildingsPage->show()
      10. #5 {main}
      it looks that this error appears when I cancel a building from the queue
    • _date('U', 1.7313943249827E+87, 'Europe/Berlin')


      The 1.7333....+87 should actually be a timestamp value, simple check the variable concerning and fix it ?

      Sincerely,



      PS: are you trying to remove an item from the queu or to cancel the construction that is busy ?