I am trying to format a date that is grabbed from a class that returns a
timestamp. I can echo the variable and it prints correctly but if I pass it
to the date function it doesn't. I figured out that the number is passed
from the class as a string and not an integer. I thought I could just set
the type to integer and it would work, but it doesn't. I'm a little confused
because it really seems like I am saying the same thing both times but PHP
disagrees. Is there something I am missing here?
Thanks,
--ScareCrowe
Here is the script:
<?
$thistime=$abc->timeStats("StartTime");// This would return '980126114' as a
string, value is from remote XML parsed with eregi (just FYI)
echo $thistime." => ".gettype($thistime)."<br>\n"; //show the var type
settype($thistime, "integer");//change var to integer
echo $thistime." => ".gettype($thistime)."<br>\n";//show the var type
?>
returns:
980126114 => string
0 => integer
<?
$thistime="980126114";// here the value is explicit
echo $thistime." => ".gettype($thistime)."<br>\n";//show the var type
settype($thistime, "integer");//change var to integer
echo $thistime." => ".gettype($thistime)."<br>\n";//show the var type
?>
returns:
980126114 => string
980126114 => integer
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----