IBM QRadar SOAR

IBM QRadar SOAR

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Incident Time

    Posted 03/25/22 10:16 AM
    Hello,

    How I can convert incident.discovered_date to human readable format in Python 3?

    In Python 2 I can do it like this:

    from java.util import Date
    creation_date = Date(incident.discovered_date)

    But when I try to convert it in Python 3 I got an error.

    ------------------------------
    Alexey Fedorov
    ------------------------------


  • 2.  RE: Incident Time

    Posted 03/28/22 09:01 AM
    The import shown above looks like Java syntax. That works because the implementation is based on a Java Python interpreter.

    Try one of the examples from here: https://www.programiz.com/python-programming/datetime/strftime for Python 3.

    Ben

    ------------------------------
    Ben Lurie
    ------------------------------



  • 3.  RE: Incident Time

    Posted 03/28/22 09:07 AM
    Hello Ben,

    I found the solution:

    import datetime
    creation_date = datetime.datetime.fromtimestamp(incident.discovered_date / 1e3).strftime('%d-%m-%Y %H:%M:%S')

    ------------------------------
    Alexey Fedorov
    ------------------------------