Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. // para p1.exe
  2. #include <time.h>
  3. #include <stdio.h>
  4.  
  5. main()
  6. {
  7. int data;
  8. struct tm *ptr, *gm;
  9. time_t lt;
  10. lt=time(NULL);
  11. gm=gmtime(&lt);
  12. ptr=localtime(&lt);
  13. printf("GMTIME ----> ");
  14. printf(asctime(gm));
  15. printf("LOCALTIME -> ");
  16. printf(asctime(ptr));
  17. }
  18.  
  19.  
  20. Resultado:
  21. GMTIME ----> Sat Feb 18 09:03:43 2017
  22. LOCALTIME -> Sat Feb 18 09:03:43 2017
  23.  
  24.  
  25. // para p2.exe
  26. #include <time.h>
  27. #include <stdio.h>
  28.  
  29. main()
  30. {
  31. int data;
  32. struct tm *ptr, *gm;
  33. time_t lt;
  34. lt=time(NULL);
  35. gm=gmtime(&lt);
  36. printf("GMTIME ----> ");
  37. printf(asctime(gm));
  38. ptr=localtime(&lt);
  39. printf("LOCALTIME -> ");
  40. printf(asctime(ptr));
  41. }
  42.  
  43. Resultado:
  44. GMTIME ----> Sat Feb 18 11:04:00 2017
  45. LOCALTIME -> Sat Feb 18 09:04:00 2017
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement