linux的man页中对gettimeofday函数的说明中,有这样一个说明: $ man gettimeofday DESCRIPTION The functions gettimeofday and settimeofday can get and set the time as well as a timezone. The tv argument is a timeval struct, as specified in <sys/time.h>: …
date +"%F" 输出格式:2011-12-31 date +"%F %H:%M:%S" 输出格式:2011-12-31 16:29:50 这都是打印出系统的当前时间,如果要获取相对当前时间的某个时间,需要怎么做,通过 -d 参数就能实现.例如: 代码如下: date -d"tomorrow" +"%F %H:%M:%S" 输出明天这个时候的时间 date -d"yesterday" +"%F…