Do not pass numeric strings to strtotime() when formatting dates.

strtotime() will return false and the date will be formatted as the 0-timestamp
(e.g. January 1, 1970 00:00) otherwise.
Changing elseif statement to what the PEAR coding guidelines say.
Add datetime test for numeric string.