For what little it may be worth, here are the two templates I use for the Time Read and Remaining Reading Time with hr:min:sec displayed. Basically a borrow from the original template in message#2 in this thread and chaley's template in the
message #820 in the
Templates: various questions not worth their own thread thread. My original code wasn't nearly as pretty since I tried using gmtime and strftime in a Python template.
Code:
program:
total = $#kobo_time_spent_reading;
hours = floor(total/3600);
minutes = floor(mod(total, 3600)/60);
seconds = mod(total, 60);
def format(v, str):
if v == 0 then return '' fi;
return v & ' ' & str & ' '
fed;
format(hours, 'hr') & format(minutes, 'min') & format(seconds, 'sec')
Code:
program:
total = $#kobo_rest_of_book_estimate;
hours = floor(total/3600);
minutes = floor(mod(total, 3600)/60);
seconds = mod(total, 60);
def format(v, str):
if v == 0 then return '' fi;
return v & ' ' & str & ' '
fed;
format(hours, 'hr') & format(minutes, 'min') & format(seconds, 'sec')