Created
November 24, 2012 01:02
-
-
Save alanedwardes/4137891 to your computer and use it in GitHub Desktop.
Get the Timestamp as a Char Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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