Home Human Time Difference

    Human Time Difference


    It’s often more appropriate to return a date difference in a human readable string. We’ve posted a version of WordPress’ human_time_diff() function here (to be used outside of WP). However, there are countless means of achieving the same result. The following is a function we also regularly use.

    The function accepts any strtotime() compatible time string.

    See also our WP snippet: Display Time To Published or Scheduled Posts.

    Shortt URL for this post: http://shor.tt/17G5