如何在 CanvasJS 图表中显示格式化的日期时间?

How to display formatted datetime in CanvasJS chart?

如何在 canvas js 图表中显示格式化的日期时间?

 <?php $dateTime = new DateTime($row['Time']);
$formatted = $dateTime->format("g:i:s:v a F j, Y");?>          

这就是我在另一页上显示日期的方式,问题出在这一页

$a = array("y" => $row['setPercent'], 'label' => date("g:i:s:v a F j, Y ", strtotime($row['setTime'])));
        array_push($dataPoints, $a);

如何使用顶部代码在图表中显示毫秒数,这个

 date("g:i:s:v a F j, Y ", strtotime($row['setTime'])) 

显示 12:05:10:000 pm April 25,2018 不显示毫秒。

只需将顶部的代码与 $row['setTime'] 值一起使用并将其插入到数组中。

$dateTime = new DateTime($row['setTime']);
$setTime = $dateTime->format("g:i:s:v a F j, Y");

$a = array("y" => $row['setPercent'], 'label' => $setTime);
array_push($dataPoints, $a);