Skip to content

Commit 3adb5d4

Browse files
author
Erik Schilling
committed
Simplified Date substraction
DateTime overloads the - operator.
1 parent ce6e5c9 commit 3adb5d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/Noesis.Javascript/SystemInterop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ SystemInterop::ConvertToSystemString(std::string iString)
337337
double
338338
SystemInterop::ConvertFromSystemDateTime(System::DateTime^ iDateTime)
339339
{
340-
System::DateTime^ startDate = gcnew System::DateTime(1970, 1, 1);
341-
System::TimeSpan^ timespan = System::TimeSpan::FromTicks(iDateTime->Ticks - startDate->Ticks);
340+
System::DateTime^ startDate = gcnew System::DateTime(1970, 1, 1);
341+
System::TimeSpan^ timespan = *iDateTime - *startDate;
342342

343343
return timespan->TotalMilliseconds;
344344
}

0 commit comments

Comments
 (0)