Commit 8e28d9d2 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Fix longstanding off by one error. (gnumeric_today): ditto (gnumeric_now):

1998-10-28  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/fn-date.c (gnumeric_date): Fix longstanding off by one
	error.
	(gnumeric_today): ditto
	(gnumeric_now): ditto.
parent 46186608
1998-10-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-date.c (gnumeric_date): Fix longstanding off by one
error.
(gnumeric_today): ditto
(gnumeric_now): ditto.
* Prepare for 0.4 release.
* configure.in: Add test for new GTK+ selection code.
......
1998-10-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-date.c (gnumeric_date): Fix longstanding off by one
error.
(gnumeric_today): ditto
(gnumeric_now): ditto.
* Prepare for 0.4 release.
* configure.in: Add test for new GTK+ selection code.
......
1998-10-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-date.c (gnumeric_date): Fix longstanding off by one
error.
(gnumeric_today): ditto
(gnumeric_now): ditto.
* Prepare for 0.4 release.
* configure.in: Add test for new GTK+ selection code.
......
1998-10-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-date.c (gnumeric_date): Fix longstanding off by one
error.
(gnumeric_today): ditto
(gnumeric_now): ditto.
* Prepare for 0.4 release.
* configure.in: Add test for new GTK+ selection code.
......
......@@ -52,7 +52,7 @@ gnumeric_date (struct FunctionDefinition *fd, Value *argv [], char **error_strin
}
v = value_int (
calc_days (year, month, day) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......@@ -79,7 +79,7 @@ gnumeric_today (FunctionDefinition *fd, Value *argv [], char **error_string)
v = value_int (
calc_days (tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......@@ -115,7 +115,7 @@ gnumeric_now (FunctionDefinition *fd, Value *argv [], char **error_string)
v = value_float (
calc_days (tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday) +
((tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec)/(double)DAY_SECONDS) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......
......@@ -52,7 +52,7 @@ gnumeric_date (struct FunctionDefinition *fd, Value *argv [], char **error_strin
}
v = value_int (
calc_days (year, month, day) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......@@ -79,7 +79,7 @@ gnumeric_today (FunctionDefinition *fd, Value *argv [], char **error_string)
v = value_int (
calc_days (tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......@@ -115,7 +115,7 @@ gnumeric_now (FunctionDefinition *fd, Value *argv [], char **error_string)
v = value_float (
calc_days (tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday) +
((tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec)/(double)DAY_SECONDS) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......
......@@ -52,7 +52,7 @@ gnumeric_date (struct FunctionDefinition *fd, Value *argv [], char **error_strin
}
v = value_int (
calc_days (year, month, day) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......@@ -79,7 +79,7 @@ gnumeric_today (FunctionDefinition *fd, Value *argv [], char **error_string)
v = value_int (
calc_days (tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......@@ -115,7 +115,7 @@ gnumeric_now (FunctionDefinition *fd, Value *argv [], char **error_string)
v = value_float (
calc_days (tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday) +
((tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec)/(double)DAY_SECONDS) -
calc_days (1900, 1, 1) + 1);
calc_days (1900, 1, 1));
return v;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment