linux下获取时间的函数

#include<stdio.h>
#include"time.h"
int main(void)
{


 time_t now;   
 struct tm *timenow;  
 char my_time[256];
 time(&now);   
 timenow = localtime(&now);
 strftime(my_time,100,"%H:%M/%m-%d",timenow);
 printf("**********%s\n\n",my_time);

 

 return 1;
}

;