You are here

setdate c

setdate function is used to change system date.

C programming code for setdate

  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<dos.h>
  4.  
  5. main()
  6. {
  7.    struct date d;
  8.  
  9.    printf("Enter the new date ( day, month and year ) as integers ");
  10.    scanf("%d%d%d",&d.da_day,&d.da_mon,&d.da_year);
  11.  
  12.    setdate(&d);
  13.  
  14.    printf("Current system date is %d/%d/%d\n",d.da_day,d.da_mon,d.da_year);
  15.  
  16.    getch();
  17.    return 0;
  18. }