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