struct tm *gmtime(const time_t *timer);
Parameter:
timer: con trỏ trỏ tới vùng nhớ lưu trữ thời gian
Remark:
Hàm gmtime( ) convert timer thành thời gian UTC
struct tm chứa thông tin giờ, phút, giây,…
Ví dụ:
#include "stdio.h" #include "conio.h" #include "time.h" void main( void ) { time_t ltime; struct tm *info; time( <ime ); info = gmtime( <ime ); printf("Current local time and date UTC: %s", asctime(info)); getch(); }
Kết quả:
Leave a Reply
You must be logged in to post a comment.