• Advertisement

Archived

This topic is now archived and is closed to further replies.

Time in VC

This topic is 5070 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to get the h,m,s and mili seconds in a windows 32 console application. In turbo c under DOS inviorment I used the gettime(&t); function to retrive the current time, when t is a time structure. But the gettime function was in the dos.h, and i cant use it under my application. So how do i get the time?

Share this post


Link to post
Share on other sites
Advertisement

/* time example */
#include <stdio.h>
#include <time.h>

int main ()
{
time_t seconds;

seconds = time (NULL);
printf ("%ld hours since January 1, 1970", seconds/3600);

return 0;
}

Share this post


Link to post
Share on other sites
the _ftime worked for me thanks

[edited by - spree on April 4, 2004 7:01:50 AM]

Share this post


Link to post
Share on other sites

  • Advertisement