Guest User

Untitled

a guest
Sep 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. gpshour = nmea.getHour();
  2. gpsminute = nmea.getMinute();
  3.  
  4. // Timezone correction
  5. if (gpshour == 0 || gpshour <= 13)
  6. {
  7. gpshour += timeZoneOffset;
  8. }
  9.  
  10. else
  11. {
  12. gpshour -= (24 - timeZoneOffset);
  13. }
  14.  
  15. // Convert to 12hr time instead of 24hr time?
  16. if (twelveHourTime)
  17. {
  18. if (gpshour == 0)
  19. {
  20. gpshour = 12;
  21. }
  22.  
  23. else if (gpshour > 12)
  24. {
  25. gpshour -= 12;
  26. }
  27. }
  28.  
  29.  
  30. // Hours
  31. e = (char)gpshour / 10;
  32. f = (char)gpshour % 10;
  33.  
  34. // Minutes
  35. g = (char)gpsminute / 10;
  36. h = (char)gpsminute % 10;
  37.  
  38. if (e > 9)
  39. {
  40. e = 0;
  41. }
  42.  
  43. if (e < 0)
  44. {
  45. e = 0;
  46. }
  47.  
  48. if (f > 9)
  49. {
  50. f = 0;
  51. }
  52.  
  53. if (f < 0)
  54. {
  55. f = 0;
  56. }
  57. if (g > 9)
  58. {
  59. g = 0;
  60. }
  61.  
  62. if (g < 0)
  63. {
  64. g = 0;
  65. }
  66.  
  67. if (h > 9)
  68. {
  69. h = 0;
  70. }
  71.  
  72. if (h < 0)
  73. {
  74. h = 0;
  75. }
  76.  
  77. RefreshTimeClock();
Advertisement
Add Comment
Please, Sign In to add comment