Re: All Monday's & Thursdays



On Fri, 30 Jun 2006 06:54:31 -0400, Janwillem Borleffs <jw@xxxxxxxxxxxxx> 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.
.



Relevant Pages

  • Bash example point-of-sale script for pool halls
    ... else echo $iname $IPRICE fi ... echo $timestamp for hanging in $do elapsedMinutes $TIMESTAMP $tablecalc $$elapsedmin echo $tablenet "table net " done} ... riser read junk} ...
    (comp.unix.shell)
  • Re: Formatting a Date Stamp on Echo
    ... > created in a record set. ... > Can anyone tell me how I can echo the value in the correct date format? ... A TIMESTAMP returns from MySQL as, eg, "20040512171115". ... You cannot apply that to the PHP datefunction (or you can, ...
    (comp.lang.php)
  • Re: Timestamp monitoring
    ... check the timestamp of the last file and do something is one file has ... if not exist c:\dir.txt goto:Label1 ... Remove the word "echo" in Line 3 to activate the batch file. ...
    (microsoft.public.windows.file_system)
  • Re: how to change the time stamp of a file ?
    ... :: Change a file's timestamp to the current date and time ... ECHO Current date/time is %MyDate% %MyTime% ... Lists or changes date and time stamps on files. ... Omit both date and time to list the current date/time stamps. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Comparing Two Dates Using PHP from MYSQL Database
    ... Im trying to compare two dates in MYSQL. ... ORDER BY `timestamp` DESC "; ... echo $convertedTime; ...
    (comp.lang.php)