You are here: Re: All Monday's & Thursdays « All PHP « IT news, forums, messages
Re: All Monday's & Thursdays

Posted by Janwillem Borleffs on 06/30/06 10:54

malcolm wrote:
> Here's the script I used;
[...]
> <?php
> $day = date('D', $ts = strtotime('thursday', $ts));
> echo "$day";
>

Note that $ts isn't initialized, so what you are really passing to date() as
the timestamp is 0, at least on my WinXP setup running PHP 5.1.2.

Perhaps earlier PHP versions translate your code into a negative timestamp,
or strtotime returns an error, which also results into a negative timestamp
(-1).

Try something as follows instead:

$day = date('D', $ts = strtotime('thursday'));

When this also returns an error, try capitalizing "thursday":

$day = date('D', $ts = strtotime('Thursday'));


JW

 

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

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