hello every one got a new doubt what is the syntax to use the years in c++ from the inbuilt date class

mvmalderen commented: Start a new thread about it and don't ressurect a 4 year old thread! Look at the date of the latest post before posting!! -2

Recommended Answers

All 2 Replies

#include <time.h>
#include<iostream>
#include<cstdlib>
#include <stdio.h>
using namespace std;

char dateStr [9];
char timeStr [9];

void display() {
     cout << "\n\n\t\t\t MY DIGITAL CLOCK \n\n\n\n";
     _strdate( dateStr);
     cout << "\t\t\n\n The current date is: " << dateStr << "\n\n";
     _strtime( timeStr );
     cout << "\t\t\n\n The current time is: " << timeStr << "\n\n\n";
}
int main( ) {
    display();      

    return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.