Latest Movie :
Home » , » C Program to Set/Change the Current System Time

C Program to Set/Change the Current System Time

{[['']]}

This program can be used to set or change the system time
#include <stdio.h>
#include <dos.h> int main(void)
{
struct time t;
gettime(&t);
printf(“The current hour is: %d\n”, t.ti_hour);
printf(“The current min is: %d\n”, t.ti_min);
printf(“The current second is: %d\n”, t.ti_sec);
/* Add one to the hour,minute & sec struct element and then call settime */
t.ti_hour++;
t.ti_min++;
t.ti_sec++;
settime(&t);
printf(“The current hour is: %d\n”, t.ti_hour);
printf(“The current min is: %d\n”, t.ti_min);
printf(“The current second is: %d\n”, t.ti_sec);
return 0;
}
Share this article :

Post a Comment

Feel Free to Say thanks Comment Here

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. SoftwareLibrary4u - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger