> Online tutorial : getdate() in c
Showing posts with label getdate() in c. Show all posts
Showing posts with label getdate() in c. Show all posts

getdate() in c

getdate()
Gets or sets DOS system date

Declaration:
void getdate(struct date *datep);
Remarks:
getdate fills in the date structure *datep with the system's current date.
Return Value:
getdate: None
On success, returns 0
Otherwise, returns a non-zero value and
sets errno to EINVAL (Invalid date)
Program
#include <stdio.h>
#include<dos.h>
int main(void)
{
struct date d;
getdate(&d);
printf("The current year is: %d\n", d.da_year);
printf("The current day is: %d\n", d.da_day);
printf("The current month is: %d\n", d.da_mon);
return 0;
}