Friday, 1 June 2012

0

Display Date and Time in C++

  • Friday, 1 June 2012
  • Here is some sample code that shows how to get the date and time on a DOS system.
    #include
    #include
    #include

    void main()
    {
    struct dosdate_t tipsplanet;
    _dos_getdate(&tipsplanet);
    clrscr();
    printf("The current year is: %d\n", tipsplanet.year);
    printf("The current day is: %d\n", tipsplanet.day);
    printf("The current month is: %d\n", tipsplanet.month);
    }

    Comment & Share with Friends :)

    0 Responses to “Display Date and Time in C++”

    Post a Comment

    Subscribe



    Enter your email address: