Display Date and Time in C++

0 votes
asked Dec 19, 2013 in C++ by raghav

1 Answer

0 votes
answered Dec 19, 2013 by Govind

Here is some sample code that shows how to get the date and time on a DOS system. 


void main()
  struct dosdate_t govind;
  printf("The current year is: %d\n", govind.year);
  printf("The current day is: %d\n", govind.day);
  printf("The current month is: %d\n", govind.month);