|
Posted by malcolm on 06/30/06 12:12
On Fri, 30 Jun 2006 06:54:31 -0400, Janwillem Borleffs <jw@jwscripts.com>
wrote:
> 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
>
>
Here's antoher attempt;
<?php
$day = date('D', $ts = strtotime('thursday', $ts));
echo "$day";
$day1 = date('D', $ts = strtotime('thursday'));
echo "<br>$day1";
$day2 = date('D', $ts = strtotime('Thursday'));
echo "<br>$day2<br>";
$today = strtotime('friday');
echo $today;
?>
here's the output;
Warning: date() [function.date]: Windows does not support dates
prior to midnight (00:00:00), January 1, 1970 in
C:\apachefriends\xampp\next_thursday.php on line 9
Thu
Thu
1151640000
I find that the code 'Lost' posted in this thread works fine,
I am only curious about this, thanks for your indulgence.
Navigation:
[Reply to this message]
|