Home Forums Kamanja Forums Data Science & Models Format of EventData in ModelResult

This topic contains 3 replies, has 3 voices, and was last updated by  Archived_User64 1 year, 8 months ago.

  • Author
    Posts
  • #13069 Reply

    Archived_User64
    Participant

    Hi-

    How do we read the event date coming in ModelResult ” “EventDate”:1422259242656″ “?

    What format are we using here?

    “ExecutionTime”:”2015-01-26T16:53:42.656-08:00″,
    “EventDate”:1422259242656,
    “TxnId”:100000000000021,
    “ModelName”:”com.ligadata.pmml.System_COPDRiskAssessment_100″,
    “uniqKey”:”{“Version”:1,
    “Type”:”Kafka”,
    “Name”:”testin_1″,
    “TopicName”:”testin_1″,
    “PartitionId”:0}”,
    “uniqVal”:”{“Version”:1,
    “Offset”:1393}”,
    “ModelVersion”:”100″,
    “DataReadTime”:”2015-01-26 16:53:42.620″,
    “xformCntr”:1,
    “ElapsedTimeFromDataRead”:35994
    }

    Regards,

    Pankaj.

  • #13071 Reply

    Archived_User1
    Participant

    Hi ,

    The format used here is epic timeStamp in milliseconds

    Regards,
    Ayman

  • #13072 Reply

    Archived_User13
    Participant

    Pankaj,

    The mentioned number is a java date (in millisecs with epoch = 1970). Something joda timestamp format function would do the job.

    Something like this could be used to format it:

    /**
    Answer a String from the time in timestampStr argument formatted according to the format string
    argument presented.
    @param fmtStr – instructions on how to format the string. @see iso860DateFmt for format info
    @param timestamp – the number of millisecs since epoch
    @return a Long representing the timestamp as millisecs since the epoch (1970 based)
    */
    def timestampFmt(fmtStr : String, timestamp : Long): String = {
    val dateTime : DateTime = new DateTime(timestamp);
    val fmt : DateTimeFormatter = DateTimeFormat.forPattern(fmtStr);
    val str : String = fmt.print(dateTime);
    str
    }

  • #13074 Reply

    Archived_User64
    Participant

    Thanks.

    Regards,

    Pankaj.

Reply To: Format of EventData in ModelResult
Your information: