mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 17:37:25 +02:00
Problèmes de date
This commit is contained in:
@ -9,14 +9,14 @@ function ensure($bool, $error_msg = "")
|
||||
function formatDate($date = NULL, $with_time = false)
|
||||
{
|
||||
if ($date == NULL)
|
||||
$date = date("yyyy-mm-dd");
|
||||
$date = date("Y-m-d H:i:s");
|
||||
|
||||
return strftime("%d %B %G" . ($with_time ? " %H:%M" : ""), strtotime($date));
|
||||
}
|
||||
|
||||
function dateWellFormed($date, $with_time = false)
|
||||
{
|
||||
return date_parse_from_format($with_time ? "yyyy-mm-dd HH-MM:ss" : "yy-mm-dd", $date) !== false;
|
||||
return date_parse_from_format($with_time ? "Y-m-d H:i:s" : "Y-m-d", $date) !== false;
|
||||
}
|
||||
|
||||
function genRandomPhrase($size, $uppercase = false)
|
||||
|
Reference in New Issue
Block a user