Quote:
Originally Posted by Wallie987
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');
}