Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get the Timestamp as a Char Array
char* GetTimestamp()
{
time_t rawtime;
struct tm* timeinfo;
time(&rawtime);
timeinfo = localtime(&rawtime);
char* time = asctime(timeinfo);
char* newLine = strstr(time, "\n");
if (newLine)
{
*newLine = 0;
}
return time;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.