Re: Question about date()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7 Oct 2008, at 12:38, Jason Pruim wrote:
I am trying to track down an error and can't seem to figure it out... Here is the error out of my log:

[Tue Oct 7 07:31:43 2008] [error] PHP Warning: date() expects parameter 2 to be long, string given in /Volumes/RAIDer/webserver/ Documents/dev/stimecard/timecard.php on line 57


Here is line 57:

$timeout = date("m/d/y h:i:s A", $row['timeout']);


And the info that is trying to grab from the database is:

+------------+------------+-------+--------+-------------------+
| timein     | timeout    | empID | record | Name              |
+------------+------------+-------+--------+-------------------+
| 1222354037 | 1222382837 |     1 |    107 | Jason Pruim       |
+------------+------------+-------+--------+-------------------+

Now... the error only happens on line 57... On line 56 there is the same command except: $timein = date("m/d/y h:i:s A", $row['timein']);

And that doesn't cause any errors so I'm at a bit of a loss as to what to do? I know I can redirect the warning to an error message, but I don't want to do that... I am trying real hard to write clean code... And this is my last error...

It's a total cosmetic thing since it still displays everything right...

Any ideas? :)

Do a var_dump($row['timeout']) on the line before the one giving the warning to check that it contains what you think it does.

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux