Skip to content

Commit

Permalink
Simplified Date substraction
Browse files Browse the repository at this point in the history
DateTime overloads the - operator.
  • Loading branch information
Erik Schilling authored and oliverbock committed Sep 21, 2018
1 parent ce6e5c9 commit 16791dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Noesis.Javascript/SystemInterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ SystemInterop::ConvertToSystemString(std::string iString)
double
SystemInterop::ConvertFromSystemDateTime(System::DateTime^ iDateTime)
{
System::DateTime^ startDate = gcnew System::DateTime(1970, 1, 1);
System::TimeSpan^ timespan = System::TimeSpan::FromTicks(iDateTime->Ticks - startDate->Ticks);
System::DateTime^ startDate = gcnew System::DateTime(1970, 1, 1);
System::TimeSpan^ timespan = *iDateTime - *startDate;

return timespan->TotalMilliseconds;
}
Expand Down

0 comments on commit 16791dc

Please sign in to comment.