Open zhmuyu opened 4 years ago
/**
@return null|string */ public function toJSON() { return $this->toISOString(); }
@return null|string */ public function toISOString($keepOffset = false) { if (!$this->isValid()) { return null; }
$yearFormat = $this->year < 0 || $this->year > 9999 ? 'YYYYYY' : 'YYYY'; $tzFormat = $keepOffset ? 'Z' : '[Z]'; $date = $keepOffset ? $this : $this->copy()->utc(); return $date->isoFormat("$yearFormat-MM-DD[T]HH:mm:ss.SSSSSS$tzFormat");
}
It looks like you posted some code, but not explained what your idea/suggestion is. Could you tell us more about what you want to do?
您似乎发布了一些代码,但没有解释您的想法/建议是什么。您能告诉我们更多您想做什么吗?
/**
@return null|string */ public function toJSON() { return $this->toISOString(); }
/**
@return null|string */ public function toISOString($keepOffset = false) { if (!$this->isValid()) { return null; }
}