Skip to content

Commit cce6f77

Browse files
committed
Rework datetime handling in Convert (#222)
***NO_CI*** (cherry picked from commit 717def9)
1 parent 37c85de commit cce6f77

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nanoFramework.CoreLibrary/System/Convert.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static class Convert
3838
internal static extern double NativeToDouble(string value, bool throwException, out bool success);
3939

4040
[MethodImpl(MethodImplOptions.InternalCall)]
41-
internal static extern DateTime NativeToDateTime(string value, bool throwException, out bool success);
41+
internal static extern void NativeToDateTime(string value, bool throwException, out bool success, out DateTime result);
4242

4343
/// <summary>
4444
/// Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value.
@@ -177,10 +177,13 @@ public static byte ToByte(bool value)
177177
/// </remarks>
178178
public static DateTime ToDateTime(string value)
179179
{
180-
return NativeToDateTime(
180+
NativeToDateTime(
181181
value,
182182
true,
183-
out _);
183+
out _,
184+
out DateTime result);
185+
186+
return result;
184187
}
185188

186189
/// <summary>

0 commit comments

Comments
 (0)