linux下用time(NULL)函数和localtime()获取当前时间的方法