note 128601 added to function.getdate
| From: | Pavel at main dot php dot net | Date: | Sat, 10 Jun 2023 15:10:47 +0000 |
| Subject: | note 128601 added to function.getdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220558@lists.php.net to get a copy of this message | ||
function getFormattedDate(){
$dateArray = getdate();
$day = sprintf("%02d", $dateArray['mday']); // Current day (for example 10)
$month = sprintf("%02d", $dateArray['mon']); // Current month (for example
6)
$year = $dateArray['year']; // Current year (for example 2023)
$formattedDate = $day . "." . $month . "." . $year; // DD.MM.YYYY
return $formattedDate;
}
echo getFormattedDate(); // It should turn out 10.06.2023
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 93.170.157.35)
----
Manual Page -- https://php.net/manual/en/function.getdate.php
Edit -- https://main.php.net/note/edit/128601
Del: integrated -- https://main.php.net/note/delete/128601/integrated
Del: useless -- https://main.php.net/note/delete/128601/useless
Del: bad code -- https://main.php.net/note/delete/128601/bad+code
Del: spam -- https://main.php.net/note/delete/128601/spam
Del: non-english -- https://main.php.net/note/delete/128601/non-english
Del: in docs -- https://main.php.net/note/delete/128601/in+docs
Del: other reasons-- https://main.php.net/note/delete/128601
Reject -- https://main.php.net/note/reject/128601
Search -- https://main.php.net/manage/user-notes.php