Use put_time() to replace strftime()