mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 20:19:41 +00:00
Core - Migrate from CefTime to CefBaseTime (CefNavigationEntry)
- Add new method to convert from CefBaseTime to DateTime Issue #4234
This commit is contained in:
@@ -300,12 +300,7 @@ namespace CefSharp
|
||||
return gcnew NavigationEntry(current, DateTime::MinValue, nullptr, -1, nullptr, nullptr, (TransitionType)-1, nullptr, false, false, sslStatus);
|
||||
}
|
||||
|
||||
//TODO: Issue #4234
|
||||
auto baseTime = entry->GetCompletionTime();
|
||||
CefTime time;
|
||||
cef_time_from_basetime(baseTime, &time);
|
||||
|
||||
DateTime completionTime = CefTimeUtils::ConvertCefTimeToDateTime(time.GetDoubleT());
|
||||
DateTime completionTime = CefTimeUtils::FromBaseTimeToDateTime(entry->GetCompletionTime().val);
|
||||
auto ssl = entry->GetSSLStatus();
|
||||
X509Certificate2^ sslCertificate;
|
||||
|
||||
|
||||
@@ -32,6 +32,20 @@ namespace CefSharp.Internals
|
||||
return DateTime.FromFileTime(val * 10);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from CefBaseTime to DateTime
|
||||
/// </summary>
|
||||
/// <param name="val">
|
||||
/// Represents a wall clock time in UTC. Values are not guaranteed to be monotonically
|
||||
/// non-decreasing and are subject to large amounts of skew. Time is stored internally
|
||||
/// as microseconds since the Windows epoch (1601).
|
||||
/// </param>
|
||||
/// <returns>returns a <see cref="DateTime"/> of <see cref="DateTimeKind.Local"/></returns>
|
||||
public static DateTime FromBaseTimeToDateTime(long val)
|
||||
{
|
||||
return DateTime.FromFileTime(val * 10);
|
||||
}
|
||||
|
||||
public static DateTime ConvertCefTimeToDateTime(double epoch)
|
||||
{
|
||||
if (epoch == 0)
|
||||
|
||||
Reference in New Issue
Block a user