You are here

setdate c

setdate function is used to change system date.

C programming code for setdate

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

main()
{
   struct date d;

   printf("Enter the new date ( day, month and year ) as integers ");
   scanf("%d%d%d",&d.da_day,&d.da_mon,&d.da_year);

   setdate(&d);

   printf("Current system date is %d/%d/%d\n",d.da_day,d.da_mon,d.da_year);

   getch();
   return 0;
}