• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Data Point Details "Export CSV" does not show date/time

    User help
    2
    7
    3.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      ray
      last edited by

      When I export a csv file from Data Point Details, It shows something like

      "value","timestamp","annotation"
      "0.0","1458648000000",
      "0.5","1458651600000",

      Can the module show date/time instead of timestamp ?

      The export csv should look similar to exported files in data points.
      Point name, Time, Value

      Thanks !

      1 Reply Last reply Reply Quote 0
      • R
        ray
        last edited by

        I should add that it is paid version and not trial. The Mango core is 2.7.10 and the "data point details view" is 1.0.5.

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by phildunlap

          This is the behavior of exporting points from the older data point details page. There is a github issue kicking around to enforce more consistency in the CSV exports: https://github.com/infiniteautomation/ma-core-public/issues/518

          I would advise using the other data point details page for these exports if possible. If not, a little script can convert the timestamps. Using python:

          from datetime import datetime, date
          import re
          
          inFile = open("/path/to/your/export")
          outFile = open("/path/to/your/output.csv", "w+")
          
          def myFormatter(dt) :
            if isinstance(dt, datetime) or isinstance(dt, date) :
               return dt.strftime("%m/%d/%y %I:%M:%S %p")
            else :
              print "Bad date!"
              return "Converting error"
          
          for line in inFile:
            g = line.replace("\"","").split(",")
            if len(g) < 2 or re.search("[0-9]+", g[1]) is None :
              continue
            #add back the quotes if you want
            outFile.write(g[0] + "," + myFormatter(datetime.fromtimestamp( int(g[1])/1000 )) + "," + g[2])
          
          inFile.close()
          outFile.close()
          1 Reply Last reply Reply Quote 0
          • R
            ray
            last edited by

            Thank you for your help and response. Our users do not know any programming language. Would it be possible to change in the next release of data point detail module ? Thanks !

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by phildunlap

              Like I said, you can get that data that way right now on the other data point details page. But, yes, we will consider it.

              1 Reply Last reply Reply Quote 0
              • R
                ray
                last edited by

                Because the detail data point module can do delta and other operations for hour, day and so on. If the export csv file can output all data will be very helpful. The old data point cannot do this.

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  Ah, yes. I understand.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post