Skip to content

Instantly share code, notes, and snippets.

@alanedwardes
Created November 24, 2012 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanedwardes/4137891 to your computer and use it in GitHub Desktop.
Save alanedwardes/4137891 to your computer and use it in GitHub Desktop.
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