• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

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
0
ba272
Asked:
ba272
1 Solution
 
mokuleCommented:
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now