note 130398 added to datetime.format

From: Date: Tue, 01 Jul 2025 13:39:11 +0000
Subject: note 130398 added to datetime.format
Groups: php.notes 
Request: Send a blank email to php-notes+get-222251@lists.php.net to get a copy of this message
# If you want the return of data in the array to be formatted directly in the return. public function toArray($keyName) { return [ 'category' => $keyName, 'description_add' => $this->description, 'created_at' => $this->created_at->format('Y-m-d H:i:s'), ]; } Return: "result": { "category": "DOCUMENTATION", "description_add": "Rejected for internal reasons.", "created_at": "2025-07-01 10:25:27" } ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.84.18 (proxied: 186.236.94.226) ---- Manual Page -- https://php.net/manual/en/datetime.format.php Edit -- https://main.php.net/note/edit/130398 Del: integrated -- https://main.php.net/note/delete/130398/integrated Del: useless -- https://main.php.net/note/delete/130398/useless Del: bad code -- https://main.php.net/note/delete/130398/bad+code Del: spam -- https://main.php.net/note/delete/130398/spam Del: non-english -- https://main.php.net/note/delete/130398/non-english Del: in docs -- https://main.php.net/note/delete/130398/in+docs Del: other reasons-- https://main.php.net/note/delete/130398 Reject -- https://main.php.net/note/reject/130398 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#222251) next »