TimeSpan Problem
Posted: Thu Sep 21, 2017 1:18 pm
Hi
There appears to be quite a disparity between TimeSpan in Stimulsoft against TimeSpan in C#. In my test case I'm attempting to compare the time between two dates, which returns a TimeSpan, but due to the irregular return values, it makes it very difficult to use.
C#
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).Minutes = 30
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).Hours = 1
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).TotalMinutes = 90
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).TotalHours = 1.5
Stimulsoft Expression
DateDiff(Convert.ToDateTime("2017/01/01 12:00:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Minutes = 0
DateDiff(Convert.ToDateTime("2017/01/01 12:00:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Hours = 1
DateDiff(Convert.ToDateTime("2017/01/01 12:30:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Minutes = 30
DateDiff(Convert.ToDateTime("2017/01/01 12:30:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Hours = 1.5
As you can see from the stimulsoft examples above, you seem to use "C# Minutes" for minutes and "C# TotalHours" for hours. If the intent is to use total values, as per hours and days, then minutes should be 60 and 90. Personally I would much prefer to have both options, i.e. TotalMinutes and Minutes.
Regards
Mark
There appears to be quite a disparity between TimeSpan in Stimulsoft against TimeSpan in C#. In my test case I'm attempting to compare the time between two dates, which returns a TimeSpan, but due to the irregular return values, it makes it very difficult to use.
C#
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).Minutes = 30
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).Hours = 1
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).TotalMinutes = 90
(Convert.ToDateTime("2017/01/01 12:30:00") - Convert.ToDateTime("2017/01/01 11:00:00")).TotalHours = 1.5
Stimulsoft Expression
DateDiff(Convert.ToDateTime("2017/01/01 12:00:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Minutes = 0
DateDiff(Convert.ToDateTime("2017/01/01 12:00:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Hours = 1
DateDiff(Convert.ToDateTime("2017/01/01 12:30:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Minutes = 30
DateDiff(Convert.ToDateTime("2017/01/01 12:30:00"),Convert.ToDateTime("2017/01/01 11:00:00")).Hours = 1.5
As you can see from the stimulsoft examples above, you seem to use "C# Minutes" for minutes and "C# TotalHours" for hours. If the intent is to use total values, as per hours and days, then minutes should be 60 and 90. Personally I would much prefer to have both options, i.e. TotalMinutes and Minutes.
Regards
Mark