如何获取 Kohana Jelly 时间戳 Pretty_format
我想知道是否有一些果冻经验的人会知道如何从 Jelly_Field_Timestamp 中获取时间戳的 Pretty_format 版本?
我不介意执行 date($pretty_format, $value) 只要我在循环记录时能够以某种方式获得 $pretty_format 值即可。
$tasks = Jelly::select('task')->execute();
foreach ($tasks as $task)
{
$task->time;
#??? $task->time->pretty_format;
#??? date($pretty_format, $task->time)
}
像这样的事情一定是可能的……不是吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Iirc,这是一种方法:
另一种方法是:
注意,此方法仅适用于 0.9.x 版本的 Jelly。
Iirc, this is one way to do it:
Another would be:
Note, this method only works in 0.9.x versions of Jelly.