How to use the timeago.timeago function in timeago

To help you get started, we’ve selected a few timeago examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github f-prime / Sperre / shell.py View on Github external
def do_inbox(self, line):
        my_address = config.my_data.find("data", "all")[0]["address"]
        messages = config.cache.find("messages", "all")
        if not messages:
            messages = []
        names = []
        out = []
        messages.reverse()
        for x in messages:
            if x['from'] not in names:
                names.append(x['from'])
                timeago_ = timeago.timeago(int(time.time() - x['time']))
                print x['from']+" "+x['message'] + " " + str(timeago_['value']) +" "+str(timeago_['type'])+" ago"

timeago

A very simple python library, used to format datetime with `*** time ago` statement. eg: "3 hours ago".

MIT
Latest version published 2 years ago

Package Health Score

55 / 100
Full package analysis

Similar packages