Use fg_time.[c|h] instead of calling strftime() directly

This will fix issue 64