#include "includes"

int main() {
	time_t rawtime;
	struct tm * timeinfo;
	char buffer [80];
	time ( &rawtime );
	timeinfo = localtime ( &rawtime );
	string timetest;
	timetest= strftime (buffer,80,"%Y-%m-%d",timeinfo);
    puts (buffer);
}

now instead of print the time i want add the value of the time to a variable
like this

Today=%d;
Month=%m;
Year=%y;

so i can use it where i want and when i want thnx.

never mind find it out

what did you do? I have that problem too.

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.