Re: getting funny error on working page
| From: | Daniel Brown | Date: | Wed, 16 Apr 2008 00:14:13 +0000 |
| Subject: | Re: getting funny error on working page | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-273023@lists.php.net to get a copy of this message | ||
On Tue, Apr 15, 2008 at 5:24 PM, John A DAVIS <John.A.Davis@state.or.us> wrote:
>
>
> Thanks! My guess is the production server has this set correctly and I will
> follow your advice.
> However, how would one do away with this error? What would I do to guarantee
> an string being returned instead of a date? What can I wrap the date()
> function in?
>
>
> $month=substr($thisdate,0,2);
> $day =substr($thisdate,3,2);
> $year = substr($thisdate,6,4);
>
> $d =date("M d (D)",Mktime(0,0,0,$month,$day,$year));
Sorry, my Xorg crashed. A word of wisdom: don't try the new
Compiz-Fusion on KDE with dual-headed setups yet. Let the bugs get
worked out first (or risk having a conspicuous hole in the wall the
size of your forehead like I will in a few days).
To your issue:
* What are you passing to parameter #1 of fMakeWideDate()
(then dubbed $thisdate)?
* Mktime() should be mktime(). It'll still work, but for
cleanliness, it's a recommendation.
When I run the function like so, it works without fail:
<?php
echo fMakeWideDate(date("m/d/Y"),1)."\n";
echo fMakeWideDate(date("m-d-Y"),1)."\n";
echo fMakeWideDate(date("Y/m/d"),2)."\n";
echo fMakeWideDate(date("Y.m.d"),2)."\n";
?>
Are you correctly passing the date? What do you see when you echo
out the MySQL rows?
--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!