格式化日期,如2013-11-01T08:50:43.305Z

Maybe a trivial question but I can't seem to figure this out. I need to format a date like 2013-11-01T08:50:43.305Z in PHP. I'm not sure how to add .305Z-part in the formatting. I've been looking at the docs (php's date-function documentation) but I must have overread it there... Any help is appreciated.

use this:

echo date("c");

For more reference see here: http://php.net/manual/en/function.date.php

Or you can use this format:

echo date("Y-m-dh:i:sz");

Here Z means the number of day in the current year.