Advertisement
Guest User

Time.h header Date

a guest
Aug 26th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<time.h>
  2. #include<stdio.h>
  3. void main(){
  4.     time_t timehere = time(NULL); //Make time_t var
  5.     struct tm *mytime; //Make pointer to tm struct
  6.     mytime = localtime(&timehere); //mytime pointing to localtime(time_t direction timehere)
  7.     printf("%d:%d:%d",mytime->tm_hour,mytime->tm_min,mytime->tm_sec);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement