DATE_TO/DT_TO ConversionsΒΆ

Converting from the variable type DATE or DATE_AND_TIME to a different type:

The date will be stored internally in a DWORD in seconds since Jan. 1, 1970. This value will then be converted.

When you perform a type conversion from a larger to a smaller type, you risk losing some information.

For STRING type variables, the result is the date constant.

Examples in IL:

(* Result is FALSE *)
LD D#1970-01-01
DATE_TO_BOOL
ST b

(* Result is 29952 *)
LD D#1970-01-15
DATE_TO_INT
ST i

(* Result is 129 *)
LD DT#1970-01-15-05:05:05
DT_TO_BYTE
ST byt

(* Result is 'DT#1998-02-13-14:20' *)
LD DT#1998-02-13-14:20
DT_TO STRING
ST str

Examples in ST:

(* Result is FALSE *)
b :=DATE_TO_BOOL(D#1970-01-01);

(* Result is 29952 *)
i :=DATE_TO_INT(D#1970-01-15);

(* Result is 129 *)
byt :=DT_TO_BYTE(DT#1970-01-15-05:05:05);

(* Result is 'DT#1998-02-13-14:20' *)
str:=DT_TO_STRING(DT#1998-02-13-14:20);

Examples in FUP:

../_images/114ef903591d1f000a317d311cdebbbc
../_images/fc7b4f9c591d3ec00a317d312503c05f
../_images/4452266c591d5ba20a317d317df6f6ad
../_images/d4c49565591d75f50a317d316144346f