Code snippet:
time_t currtime;
time(&currtime);
struct tm *dateAndTime = locattime(&currtime);
int year = 1900 + timedate->tm_year;
int month = dateAndTime->tm_mon+1;
int date = dateAndTime->tm_mday;
int hour = dateAndTime->tm_hour;
int min = dateAndTime->tm_min;
int sec = dateAndTime->tm_sec;
Now I can format the time-stamp string in any damn way I want. If objective-c was an option NSDate would have done the job for me.
No comments:
Post a Comment