Date: 08/30/01
- Next message: * R&zE:: "Re: [PHP] Header() function and redirect"
- Previous message: Simon Robson: "Re: [PHP] headers..."
- In reply to: Paul McGee: "[PHP] Date formatting in PHP 3.0"
- Next in thread: Paul McGee: "Re: [PHP] Date formatting in PHP 3.0"
- Reply: Paul McGee: "Re: [PHP] Date formatting in PHP 3.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<Original message>
From: Paul McGee <pmcgee <email protected>>
Date: Thu, Aug 30, 2001 at 12:13:21PM -0400
Message-ID: <20010830170839.89933.qmail <email protected>>
Subject: [PHP] Date formatting in PHP 3.0
> I'm looping through a MSQL db pulling out the dates where I would like to
> display the date and then the day of the week. The problem is that every
> date returns the same day of the week, Wed. I checked the documentation and
> it doesn't say anything about the expression only being executed once during
> inside the WHILE loop.
>
> I've tried:
>
> $m = substr($row[0],0,4);
> $d = substr($row[0],5,2);
> $y = substr($row[0],8,2);
> $dy = date ("D", mktime(0,0,0,$m,$d,$y));
>
> and just using the date field
>
> $dy = date ("D", $row[0]);
>
> Any help would be greatly appreciated!
</Original message>
<Reply>
Did you give a look at your own code?
A month consisting of 4 digits?
And a year consisting of 2 digits?
I'd say:
--- PHP code ---
$y = substr($row[0],0,4);
$m = substr($row[0],5,2);
$d = substr($row[0],8,2);
$dy = date ("D", mktime(0,0,0,$m,$d,$y));
and just using the date field
$dy = date ("D", $row[0]);
--- End of PHP code ---
</Reply>
--* R&zE:
</Reply>
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze <email protected> -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: * R&zE:: "Re: [PHP] Header() function and redirect"
- Previous message: Simon Robson: "Re: [PHP] headers..."
- In reply to: Paul McGee: "[PHP] Date formatting in PHP 3.0"
- Next in thread: Paul McGee: "Re: [PHP] Date formatting in PHP 3.0"
- Reply: Paul McGee: "Re: [PHP] Date formatting in PHP 3.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

