ctime

The task we have is the present time 06/02/2024, the task is to convert the time to the number 02062024, how can this be done? Below is the code that needs conversion
struct tm newtime;
time_t now = time(NULL);
localtime_s(&newtime, &now);

int date = newtime.tm_mday * newtime.tm_mon * 1 * newtime.tm_year * 1900;
struct tm newtime;
time_t now = time(NULL);
localtime_s(&newtime, &now);

int date = newtime.tm_mday * newtime.tm_mon * 1 * newtime.tm_year * 1900;
4 Replies
Codercord
Codercord6mo ago
Category: Other What product are you using?
Phorcys
Phorcys6mo ago
hey
Codercord
Codercord6mo ago
This is is NOT a programming help server ! You are looking at the https://coder.com discord server, which is a product that lets you use remote machines as development environments. you can ask programming-related questions at https://discord.gg/code or https://discord.gg/programming (@Orang3)
Phorcys
Phorcys6mo ago
hope they can help you
Want results from more Discord servers?
Add your server