How may I convert the seconds back to minutes, hours, days, months, years, in Python ?

Asked by Eduard Gotwig on 2012-04-07

How may I convert the seconds back to minutes, hours, days, months, years, in Python ?

Wanna use it in my gourmet recipe manager scope @ lp:lens-cooking.

please help

Question information

Language:
English Edit question
Status:
Solved
For:
Gourmet Edit question
Assignee:
No assignee Edit question
Solved by:
Eduard Gotwig
Solved:
2012-04-07
Last query:
2012-04-07
Last reply:
Eduard Gotwig (gotwig) said : #1

Here is some code from convert.py:

unit_to_seconds = {
        'seconds':1,
        'minutes':60,
        'hours':60*60,
        'days':24*60*60,
        'weeks':7*24*60*60,
        'months':31*24*60*60,
        'years':365.25*24*60*60,
        }

Eduard Gotwig (gotwig) said : #2

implemented it by my own.