0
#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.

Edited by Mr_PoP: n/a

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by jrhitokiri
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.