mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
fix format_datetime when null use current
This commit is contained in:
@@ -574,6 +574,9 @@ function last_query($all = false)
|
||||
|
||||
function format_datetime($datetime, $format = 'Y-m-d H:i')
|
||||
{
|
||||
if (empty($datetime)) {
|
||||
return '';
|
||||
}
|
||||
try {
|
||||
$carbonTime = \Carbon\Carbon::parse($datetime);
|
||||
return $carbonTime->format($format);
|
||||
|
||||
Reference in New Issue
Block a user