char *asctime(const struct tm *timeptr);
Parameter:
timeptr: con trỏ tm tới vùng nhớ
Remark:
Hàm asctime( ) covert struct tm thành định dạng như sau:
Sun Feb 03 11:38:58 2002
Ví dụ:
#include "stdio.h" #include "conio.h" #include "time.h" void main( void ) { time_t ltime; struct tm *info; time( <ime ); info = localtime( <ime ); printf("Current local time and date: %s", asctime(info)); getch(); }
Kết quả:
Leave a Reply
You must be logged in to post a comment.