RE: [PHP-WIN] date problem
| From: | Daniel Parsons | Date: | Wed, 31 Oct 2001 03:51:36 +0000 |
| Subject: | RE: [PHP-WIN] date problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-10132@lists.php.net to get a copy of this message | ||
The 10th day of the 31st month of 2001 is the same as the 10th day of
the 7th month of 2003 so I would guess that you have $pdate[3] and
$pdate[2] the wrong way round when you call mktime().
http://www.php.net/manual/en/function.mktime.php
says that it should be
like this:
int mktime (int hour, int minute, int second, int month, int day, int
year [, int is_dst])
Try swapping them :)
HTH
D.
> -----Original Message-----
> From: Brian Feliciano [mailto:brian@websensegroup.com]
> Sent: Wednesday, 31 October 2001 4:41 p.m.
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] date problem
>
>
> this is my code:
>
> ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})
> ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})",$rowsko[2], $pdate);
> echo date("l, F j, Y [h:i:s A]",
> mktime($pdate[4],$pdate[5],$pdate[6],$pdate[3],$pdate[2],2001));
>
>
> $rowsko[2] is equal to "2001-10-31 10:55:02"
> but the result was: Thursday, July 10, 2003 [10:55:02 AM]
> i printed out $pdate[1] and it shows: 2001
>
> how come it is always 2003 ? please help.
>
> thanks.
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>