home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 273_01 / getldate.cc < prev    next >
Text File  |  1988-04-19  |  1KB  |  31 lines

  1. #include <dos.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. long int get_long_date()
  6. /*
  7. ┌────────────────────────────────────────────────────────────────────┐
  8. │Purpose: Get the current date.                                      │
  9. │                                                                    │
  10. │ Inputs: None.                                                      │
  11. │                                                                    │
  12. │Outputs: None.                                                      │
  13. │                                                                    │
  14. │ Return: A long int containing the current date in the format       │
  15. │         YYMMDD.                                                    │
  16. └────────────────────────────────────────────────────────────────────┘
  17. */
  18. {
  19.  
  20. struct date today;
  21. char mystr[40];
  22. long l_date;
  23.  
  24.     getdate(&today);
  25.     sprintf(mystr,"%2.2d%2.2d%2.2d",
  26.         today.da_year - 1900,today.da_mon,today.da_day);
  27.  
  28.     l_date = atol(mystr);
  29.     return(l_date);
  30. }
  31.