Posted By

mlecho on 07/20/12


Tagged

time date c


Versions (?)

Date format in C


 / Published in: C
 

  1. #import <time.h>
  2. time_t currentTime = time(NULL);
  3. struct tm timeStruct;
  4. localtime_r(&currentTime, &timeStruct);
  5. char buffer[20];
  6. strftime(buffer, 20, "%d-%m-%Y %H:%M", &timeStruct);

Report this snippet  

You need to login to post a comment.