我正在try 获取用于绘制双曲线图的日期数组,但我的数据是100赫兹,所以我需要时间刻度在百分之一秒.我首先在php中生成数据数组,所以我的循环如下所示:
$time = strtotime($mydata['date'])*1000; // get time string 1000 times bigger for milliseconds
foreach ($data_array as $key=>$d) {
$mydate = date('Y-m-d H:i:s.v', $time/1000);
$time += 10; // add one hundredth of a second each iteration supports 1-second intervals
echo $time." : ".$mydate."<br />";
}
其输出如下所示:
1704842176010 : 2024-01-09 23:16:16.000
1704842176020 : 2024-01-09 23:16:16.000
1704842176030 : 2024-01-09 23:16:16.000
1704842176040 : 2024-01-09 23:16:16.000
1704842176050 : 2024-01-09 23:16:16.000
1704842176060 : 2024-01-09 23:16:16.000
1704842176070 : 2024-01-09 23:16:16.000
1704842176080 : 2024-01-09 23:16:16.000
1704842176090 : 2024-01-09 23:16:16.000
1704842176100 : 2024-01-09 23:16:16.000
1704842176110 : 2024-01-09 23:16:16.000
1704842176120 : 2024-01-09 23:16:16.000
1704842176130 : 2024-01-09 23:16:16.000
1704842176140 : 2024-01-09 23:16:16.000
1704842176150 : 2024-01-09 23:16:16.000
正如你所看到的,百分之一秒没有被翻译.我遗漏了什么?
谢谢,提前.