Fixed a calculation issue and added a small utility class for keeping
and converting time.
Merge remote-tracking branch 'origin/master'