2

I have the following JSON:

[
    [
        "26-Sep-14",
        10
    ],
    [
        "29-Sep-14",
        75
    ]
]

The data from the JSON is used to create a highcharts chart, which needs dates in the format Date.UTC(). Currently highcharts is treating the dates as strings. Is there a way to go through the json to format every date correctly (Date.UTC)?

The json originally comes from a Pandas dataframe so perhaps it would be better to make the changes in python before creating the JSON? However I haven't had any luck getting it work in either javascript or python.

Many thanks for any suggestions.

darkpool
  • 13,822
  • 16
  • 54
  • 89

1 Answers1

-1

Loop through your python panda data object, and for each date, use the python datetime module to convert it to the necessary format using strftime()

conrad
  • 1,783
  • 14
  • 28
  • And how do you do that? Please don't tell users to RTFM... `strftime` has a ton of options. – Cerin Jul 08 '17 at 18:21