Wednesday, 25 April 2012

C Program to Get the Current System Date

0 comments

This program can be used to set the system date or to change the current system date. It displays Year, Month and Day.
#include <stdio.h>
#include <process.h>
#include <dos.h>
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;
}

Leave a Reply

Labels

 
Welcome To Junaid's Software Blog © 2011 DheTemplate.com & Main Blogger. Supported by Makeityourring Diamond Engagement Rings

You can add link or short description here