I'm trying to use SSDatetime funcions inside the controller:
I've tried several ways, like:
$thisdatetime = ($previous_vote->datetime);
but nothing seems to work.
Can someone help? What am I doing wrong?
You need to get the fields as an object.
Wow, thanks a lot.
A couple of questions, where would the documentation for knowing something like this be?
Why would this only happen in the controller and not in the view?
If you add ?showtemplate=1 to your URL, you'll see how SSViewer parses the template. It always runs ->obj() on those fields before rendering them. Or it runs XML_val(), but I think that's just a wrapper method for obj().
In a controller or a model, it's rare that you'd want to work with fieldtype objects in your logic, since you don't need to deal with presentation, so the framework has you "opt in" to an object and stores the literal value by default.