View Single Post
  #9  
Old 05-06-2014, 10:57 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,650
IntoRain is on a distinguished road
Default

Quote:
Originally Posted by Wallie987 View Post
Oops, one more thing! Now I'm getting an error with the datetime - frozen adoptables only: DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character
Do I need to edit the datetime to show 0 when the adoptable hasn't been bred? I can't seem to find it... XP

Edit: nevermind, I found a way to fix it, but I want to replace 1970-01-01 with 0
Sorry didn't test it so didn't think of case 0!

What about
$lastbred = 0;//this way lastbred is always 0 if getLastBred() also returns 0
if($this->adopt->getLastBred() != 0){
$dt = new DateTime( "@" . $this->adopt->getLastBred() );
$lastbred = $dt->format('Y-m-d');
}
__________________


asp.net stole my soul.
Reply With Quote