Skip to content

Instantly share code, notes, and snippets.

@shkesar
Created September 22, 2016 08:41
Show Gist options
  • Save shkesar/953422ef173bce3bf0faefd7fb9c19ef to your computer and use it in GitHub Desktop.
Save shkesar/953422ef173bce3bf0faefd7fb9c19ef to your computer and use it in GitHub Desktop.
Time in C
#include <stdio.h>
#include <time.h>
int main()
{
time_t now = time(NULL);
struct tm *lt = localtime(&now);
printf("%d/%d/%d\n", lt->tm_mday, lt->tm_mon, 1900lt->tm_year);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment