Jelle Spekken Wed Mar 23 09:11:22 -0400 2011

Subject: Get created_at

Hi,

I'm fairly new to PHP-ActiveRecord and I want to grab the created_at or updated_at field from the database.
How do I do that?

Thanks in advance.


Jamon Holmgren Thu Apr 21 18:32:37 -0400 2011

Just grab the object and then you can use it as you want. It's an object itself, so be aware of that.

1 $something = Something::find_by_id($id);
2 
3 if($something ->created_at) echo $something ->created_at->format("n/j/Y");

(1-1/1)