You are here: Re: trouble making a date « PHP Programming Language « IT news, forums, messages
Re: trouble making a date

Posted by drtebi on 11/27/06 03:54

The problem is very simple. You have the parameter order wrong for
mktime. It should be this:

$reqDate = date("Y-m-d", mktime(0, 0, 0, $m, $d, $y));


Cheers,
DrTebi



On Nov 26, 7:52 pm, l...@portcommodore.com wrote:
> laredotorn...@zipmail.com wrote:
> > Hi,
>
> > Using PHP 4.4.4 and I'm getting an odd time stamp attempting to make a
> > php date. Here's the code
>
> > $reqDate = date("Y-m-d", mktime(0, 0, 0, $y, $m, $d));
> > $reqDateTS = strtotime($reqDate);
>
> > If $y = 2006, $m = 12, and $d = 28, I get a negative value for
> > $reqDateTS. What is wrong with the above statement?
>
> > Thanks, - DaveDate functions in PHP can be tricky (DST, GMT, etc. shudder),
> did you read the manual on strtotime? It probably will help you.
>
> http://us3.php.net/strtotime

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация