Turning a date into a time interval


/ Published in: ActionScript 3
Save to your folder(s)

ActionScript function for turning a date into a time interval

While working on a small Twitter utility, I wrote a function to turn a date into a time interval string. For instance, rather than formatting the date, it returns strings like "Just posted," "6 minutes ago," "4 hours ago," or "20 days ago". It's not a complex function, but I thought I'd post it here in case it might save someone a few minutes of coding. The less time we spend writing code someone else has already written, the more time we can spend innovating.

URL: http://weblogs.macromedia.com/cantrell/archives/2009/06/actionscript_fu.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.