Senin, 24 Desember 2012

Memperoleh Waktu Lokal Dengan C

Memperoleh Waktu Lokal Dengan C
Welcome in this blog. Now I’m going to share with you how to get kocal time. To get it we should use functioni "ctime", we just call that function form "berkas judul (header file)" <time.h>
Sample of local time (Sunday 23 dec 2012 08:14)
ok let’s go now.
/*
Program C untuk memperoleh
informasi waktu lokal
*/

#include <stdio.h>
#include <conio.h>
#include <time.h>

main()
{
    time_t ambil_waktu;

    time(&ambil_waktu);
    printf("Waktu Lokal Daerah Medan : \n %s ", ctime (&ambil_waktu));

    getch();
    return 0;
}


Tidak ada komentar:

Posting Komentar