How do I grab the Kohana Jelly Timestamp pretty_format

265 views Asked by At

I was wondering if anyone with some Jelly experience would happen know how one would go about grabbing the pretty_format version of a Timestamp out of a Jelly_Field_Timestamp?

I wouldn't mind doing date($pretty_format, $value) as long as I could somehow get that $pretty_format value as I'm looping through my records.

$tasks = Jelly::select('task')->execute();
foreach ($tasks as $task)
{
    $task->time;
    #??? $task->time->pretty_format;
    #??? date($pretty_format, $task->time)
}

Something like this has to be possible... is it not?

1

There are 1 answers

2
SpadXIII On BEST ANSWER

Iirc, this is one way to do it:

$time_prettyformat = Jelly::builder('task')->fields('time')->pretty_format;

Another would be:

$task->meta()->fields('time')->pretty_format;

Note, this method only works in 0.9.x versions of Jelly.