<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Incorrect TimeValue conversion to Posix time and Win32 time"
href="http://llvm.org/bugs/show_bug.cgi?id=15177">15177</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect TimeValue conversion to Posix time and Win32 time
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Support Libraries
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>stefan.bucur@epfl.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The TimeValue::toPosixTime() and TimeValue::toWin32Time() incorrectly convert
the timestamp value to Posix/Win32 ticks.
The two functions currently read as follows:
/// Converts the TimeValue into the corresponding number of "ticks" for
/// Posix, correcting for the difference in Posix zero time.
/// @brief Convert to unix time (100 nanoseconds since 12:00:00a Jan
1,1970)
uint64_t toPosixTime() const {
uint64_t result = seconds_ - PosixZeroTime.seconds_;
result += nanos_ / NANOSECONDS_PER_POSIX_TICK;
return result;
}
/// Converts the TimeValue into the corresponding number of "ticks" for
/// Win32 platforms, correcting for the difference in Win32 zero time.
/// @brief Convert to windows time (seconds since 12:00:00a Jan 1, 1601)
uint64_t toWin32Time() const {
uint64_t result = seconds_ - Win32ZeroTime.seconds_;
result += nanos_ / NANOSECONDS_PER_WIN32_TICK;
return result;
}
There is no unit conversion performed when computing the seconds part. The
values of NANOSECONDS_PER_POSIX_TICK and NANOSECONDS_PER_WIN32_TICK also seem
to be wrong (they're both 100).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>