Date calculation question

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 15, 2014   (RSS)

By Jesus - July 12, 2014 - edited: July 12, 2014

Hello everyone,

I've a table inside my CMSBuilder system which contains a date field (2014-01-01).

I've 70 records on my table and I need to know how long since that day until today (Obviously today its a dynamic value).

The results (per record) for that dynamic calculation field needs to be something like: 3 years, 2 months, 14 days

Is this possible? Will someone point me to a place for a similar situation or provide me some help in order to accomplish this? At this point I'm working just on my backend but we can create a report page if need it to complete this operation.

Thanks in advance for the help!

Jesus

By Damon - July 15, 2014

Hi,

Take a look at this function Chris wrote for Facebook-style relative times (e.g. "7 hours ago"):
http://www.interactivetools.com/forum/forum-posts.php?postNum=2208966#post2208966

....it turns a date into a more human-readable format such as "37 seconds ago", "about an hour ago", "Wednesday at 6:07pm", or "February 17, 2007", depending on how far in the past the date is. It doesn't handle future-dates at all.

This could be a starting point.

We can also write up the custom code needed through our consulting department if needed. Send in a email to consulting@interactivetools.com.

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/