I need date and time from a time_t value

Hi,

Looks like it's a Julian second, so how do I get year/month/day/hour/min/sec?

Thanks.

Bob
ba272Asked:
Who is Participating?
 
mokuleConnect With a Mentor Commented:
time_t t;
struct tm *st;
time(&t);
st = gmtime(&t);   // here You've got year month ... in a structer
printf(ctime(&t));  // or here in string
0
 
ba272Author Commented:
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.