Fixed local_time bug by using ctime() instead.