var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Datetime conversion
I'm trying to calculate the amount of minutes between two datetime variables. I want the final result to be an integer, but I don't know the syntax to use in Informix.
Any help is appreciated.
Please test with function extend(datetime, year to minute).
You can use INTERVAL datatype to calculate the time difference in the following way.
DEFINE v1 DATETIME year to second;
DEFINE v2 DATETIME year to second;
DEFINE var1 INTERVAL hour to second
LET var1 = v2 - v1
interval to integer
I've never known how to convert an interval to an integer directly... however, this is the way I managed to do it:
Originally Posted by tachek
define dt1 datetime year to second;
define dt2 datetime year to second;
define iv1 interval minute(9) to minute;
define number1 integer;
let dt1 and dt2 get whatever values are needed;
let iv1 = dt1 - dt2;
let number1 = iv1::char(10);
variable number1 gets the number of minutes passed between dt2 and dt1, which I assume you will like to use in some math expressions afterwards (if not, you could stick to the interval-type variable!)
hope this helps