Skip to content

Instantly share code, notes, and snippets.

@bDrwx
Created September 22, 2018 13:27
Show Gist options
  • Select an option

  • Save bDrwx/8608e1d24a445596b698aed44af4306f to your computer and use it in GitHub Desktop.

Select an option

Save bDrwx/8608e1d24a445596b698aed44af4306f to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <time.h>
int main()
{
time_t timer;
char buffer[26];
struct tm* tm_info;
time(&timer);
tm_info = localtime(&timer);
strftime(buffer, 26, "%Y-%m-%d %H:%M:%S", tm_info);
puts(buffer);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment