在JSON数组中搜索时间并将其转换为'epochtime'

问题描述 投票:1回答:1

如何在JSON数组中找到“time”的值,如下所示:

{
   "data": [{
               "temperature": "20.0",
               "time": "2019-04-23 12:45:00+02:00"
           }]
}

并将此值转换为如下所示的纪元时间:

{
    "data": [{
                "temperature": "20.0",
                "timestamp": 1556016300000
            }]
}
javascript arrays json time epoch
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.