我正在创建一个带有日期的 json 数组。
$result[] = array('startDate' => date("D M j G:i:s T Y"),
'endDate' => date("D M j G:i:s T Y"),
'title' => $event->title,
'description'=>$event->summary,
'priority'=>2);
我得到的结果是:
{
startDate: "Wed Nov 21 0:55:44 UTC 2012",
endDate: "Wed Nov 21 0:55:44 UTC 2012",
title: "title",
description: "desc",
priority: 2
}
但我不希望日期被引用为字符串,我需要的是:
{
startDate: Wed Nov 21 0:55:44 UTC 2012,
endDate: Wed Nov 21 0:55:44 UTC 2012,
title: "title",
description: "desc",
priority: 2
}
那么有没有办法不将日期视为字符串?