My site has been moved!

You should be automatically redirected in 6 seconds. If not, visit
http://www.hackagenius.co.cc
and update your bookmarks.




C Program to Set/Change the Current System Date

Posted by smit sanghvi Sunday, November 15, 2009


This program can be used to set the system date or to change the current system date.



#include
#include
#include

int main(void)
{
struct date reset;
struct date save_date;
getdate(&save_date);
printf(”Original date:\n”);
system(”date”);
reset.da_year = 2001;
reset.da_day = 1;
reset.da_mon = 1;
setdate(&reset);
printf(”Date after setting:\n”);
system(”date”);
setdate(&save_date);
printf(”Back to original date:\n”);
system(”date”);
return 0;
}

0 comments

Post a Comment

Visit our new website

Our Newsletter

Enter your email address To Subscribe Us Via Email:

Our SMS Updates