Update the MySQL schema

Tweaking
Cleaned up get_end_time

Return the end time, or the max time, if the end time is beyond max
time.
Functions to do time based things

Convert seconds function and human readable time left