Time in VC
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?
/* 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;}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement