bhupen
10 years agoAdvisor
how to get post_time?
Hi guyz,
I have got post title and author login but Iam not able to get the post time. Can any body help me in this:
following is the api i used:
http://community.lithium.com/restapi/vc/search/messages?q=is_root:true&sort_by=-replies
<#list messages.data.items as recent >
I used title using this syntax: ${recent.subject}
Author:${recent.author.login}
</#list>
but when I am trying to get post date at this way : ${post_time} its giving me error that "Can't convert the date to string, because it's not known which parts of the date variable are in use.
Thanks
You're developing lots of widgets !
Try this one, worked for me:
<div class="recent_digital_platform"> <h3>Trending Topics</h3> <#setting locale="en_US"> <#assign messages = rest("2.0","/search?q=" + "SELECT * FROM messages WHERE replies.count(*)>0 AND depth=0 order by replies.count(*) desc LIMIT 3"?url) /> <#if messages.data.items??> <#list messages.data.items as recent > <#if recent?has_content> <a href="${recent.view_href}">${recent.subject}</a> <span>${recent.author.login}</span> <span>${recent.post_time?datetime}</span> <br/> <#else> No post Trending Topics found. </#if> </#list> </#if> </div>