View Single Post
Old 11-26-2012, 05:08 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
That doesn't appear to match the lines you have here.
You can't trigger an error on the format there since it must be an instance of DateTime in order to issue the format call. If $result['DateEntered'] is not an instanceof DateTime (null isn't an instance, nor is any scalar or non-DateTime object), then it will drop to the ternary else. You can't have a DateTime datatype without having a valid DateTime object; so null's or any scalar (ie: non-object) type cannot pass an instanceof check. Unless there's a bug of course, but I don't believe I've seen one like this.

Post more code for this; I suspect that you have another format call elsewhere and the line number you are looking at may be incorrect. I still can't get over that the SQLServer is automatically generating DateTime objects. Its also possible that you may be in a do/while?
Fou-Lu is offline   Reply With Quote