Skip to content
Advertisement

User-friendly time format in Python?

Python: I need to show file modification times in the “1 day ago”, “two hours ago”, format.

Is there something ready to do that? It should be in English.

Advertisement

Answer

The code was originally published on a blog post “Python Pretty Date function” (http://evaisse.com/post/93417709/python-pretty-date-function)

It is reproduced here as the blog account has been suspended and the page is no longer available.

JavaScript
Advertisement