Changeset 72140 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- May 7, 2018 2:21:31 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122537
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/timelocal-posix.cpp
r72100 r72140 64 64 65 65 /* 66 * Explode it as both local and ucttime.66 * Explode it as both local and UTC time. 67 67 */ 68 68 struct tm TmLocal; … … 95 95 * Must add 24 hours to the value that is ahead of the other. 96 96 * 97 * To determin which is ahead was busted for a long long time (bugref:9078),97 * To determine which is ahead was busted for a long long time (bugref:9078), 98 98 * so here are some examples and two different approaches. 99 99 * … … 174 174 { 175 175 RTTIMESPEC LocalTime = *pTimeSpec; 176 RTTimeSpecAddNano(&LocalTime, rtTimeLocalUTCOffset(&LocalTime, true /* current time, skip fallback */)); 176 int64_t LocalUTCOffset = rtTimeLocalUTCOffset(&LocalTime, true /* current time, skip fallback */); 177 RTTimeSpecAddNano(&LocalTime, LocalUTCOffset); 177 178 pTime = RTTimeExplode(pTime, &LocalTime); 178 179 if (pTime) 180 { 179 181 pTime->fFlags = (pTime->fFlags & ~RTTIME_FLAGS_TYPE_MASK) | RTTIME_FLAGS_TYPE_LOCAL; 182 pTime->offUTC = LocalUTCOffset / RT_NS_1MIN; 183 } 180 184 return pTime; 181 185 } -
trunk/src/VBox/Runtime/r3/win/time2-win.cpp
r70345 r72140 76 76 pTime = RTTimeExplode(pTime, &LocalTime); 77 77 if (pTime) 78 { 78 79 pTime->fFlags = (pTime->fFlags & ~RTTIME_FLAGS_TYPE_MASK) | RTTIME_FLAGS_TYPE_LOCAL; 80 pTime->offUTC = (LocalTime - *pTimeSpec) / RT_NS_1MIN; 81 } 79 82 return pTime; 80 83 } … … 88 91 */ 89 92 LocalTime = *pTimeSpec; 90 RTTimeSpecAddNano(&LocalTime, RTTimeLocalDeltaNano()); 93 int64_t LocalUTCOffset = RTTimeLocalDeltaNano(); 94 RTTimeSpecAddNano(&LocalTime, LocalUTCOffset); 91 95 pTime = RTTimeExplode(pTime, &LocalTime); 92 96 if (pTime) 97 { 93 98 pTime->fFlags = (pTime->fFlags & ~RTTIME_FLAGS_TYPE_MASK) | RTTIME_FLAGS_TYPE_LOCAL; 99 pTime->offUTC = LocalUTCOffset / RT_NS_1MIN; 100 } 94 101 return pTime; 95 102 }
Note:
See TracChangeset
for help on using the changeset viewer.