[Title] Converting date string to seconds fixed
[Issue#] DCM-1358
[Problem] Date string is not correctly converted to seconds
[Cause] There's implicit cast from int to double
[Solution] Constants fixed not to be considered as double
Change-Id: Ia68f491955dc47b516cc6781f062937b4844ef2f
static inline double ymdhmsToSeconds(long year, int mon, int day, int hour, int minute, double second)
{
double days = (day - 32075)
- + floor(1461 * (year + 4800.0 + (mon - 14) / 12) / 4)
+ + floor(1461 * (year + 4800 + (mon - 14) / 12) / 4)
+ 367 * (mon - 2 - (mon - 14) / 12 * 12) / 12
- - floor(3 * ((year + 4900.0 + (mon - 14) / 12) / 100) / 4)
+ - floor(3 * ((year + 4900 + (mon - 14) / 12) / 100) / 4)
- 2440588;
return ((days * hoursPerDay + hour) * minutesPerHour + minute) * secondsPerMinute + second;
}