這樣? 這東西直接自己寫一個比較快
http://imgur.com/LiLQfHe.jpg
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SECS_PER_HOUR 3600
int main(int argc, char *argv[])
{
int curr_time = (int)time(NULL);
int h;
int new_time;
h = (argc == 2) ? atoi(argv[1]) : 0;
new_time = curr_time - (h * SECS_PER_HOUR);
printf("%s\n", asctime(localtime((time_t *)&new_time)));
return 0;
}