replaced ctime with strftime