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

Asked by Eduard Gotwig

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:
Last query:
Last reply:
Revision history for this message
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,
        }

Revision history for this message
Eduard Gotwig (gotwig) said :
#2

implemented it by my own.

Revision history for this message
Eduard Gotwig (gotwig) said :
#3