Coder Social home page Coder Social logo

Date format about mab-lab HOT 4 CLOSED

SirJohn2024 avatar SirJohn2024 commented on August 23, 2024
Date format

from mab-lab.

Comments (4)

Medialoha avatar Medialoha commented on August 23, 2024

Hello,

I'm not sure you miss something, I will check asap.

from mab-lab.

Medialoha avatar Medialoha commented on August 23, 2024

The rfc is converted before being inserted into db. The value _2013-11-18T17:04:17.000+01:00_ is already converted. I need the original value.

Edit the file report/report.php, line 90, change like this :

    Debug::logi("Seems to be a valid request... Try to decode JSON and save to DB.", 'REPORT');

    $json = json_decode($data, true);

    Debug::Logd($json['USER_CRASH_DATE'], 'CHECK_DATE');

    // open db connection
    DBHelper::open();

    $values = ReportHelper::buildMySQLValuesArr($json);

    Debug::Logd($json['USER_CRASH_DATE'], 'CHECK_DATE');

    $result = DBHelper::insertReport($values);

This will log the user crash date, before and after convertion.

from mab-lab.

SirJohn2024 avatar SirJohn2024 commented on August 23, 2024

I've looked at the code and found the problem, it lies here:

public static function buildMySQLValuesArr($json) {
$json['USER_CRASH_DATE'] = self::convertRFCDateToMySQLTimestamp($json['USER_CRASH_DATE']);

$values = array();
    ....

only USER_CRASH_DATE is converted, adding

$json['USER_APP_START_DATE'] = self::convertRFCDateToMySQLTimestamp($json['USER_APP_START_DATE']);

solves the problem, I can now write successfully to DB.

Thanks for your prompt response

Regards
Sergio

from mab-lab.

Medialoha avatar Medialoha commented on August 23, 2024

Thanks !

Script updated.

from mab-lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.