note 51911 added to ref.datetime
| From: | xavier at sunglowal dot com | Date: | Thu, 14 Apr 2005 17:37:43 +0000 |
| Subject: | note 51911 added to ref.datetime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88025@lists.php.net to get a copy of this message | ||
This is my function that converts dates to string format 'yyyymmdd':
<?php
function date_to_text($str_input) {
if (!is_string($str_input)) {
return false;
} else {
$str_output = date("Ymd", strtotime($str_input));
return $str_output;
}
}
?>
Anyone can improve it checking if $str_input it's a Gregorian valid date?
----
Manual Page -- http://www.php.net/manual/en/ref.datetime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51911
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51911&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51911&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51911&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51911&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51911&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51911&report=yes
Search -- http://master.php.net/manage/user-notes.php