Util.EncodeDateTime |
Top Previous Next |
Syntax function Util.EncodeDateTime(Year: integer; Month: integer; Day: integer; Hour: integer; Minute: integer; Second: integer; Millisecond: integer): datetime
Description Encodes the given separate Year, Month, Day, Hour, Minute, Second and Millisecond values into a combined datetime value.
The Return Value is a datetime value according to the given values.
See Also
Example execute UDSBlock as declare dtvalue timestamp; begin /* get day number from todays date */ daynr = Util.DayOfWeek(Util.Date()); GUI.ShowMessage('It''s day ' || daynr || ' of this week.');
/* init variables in order to create them implicitly, required for the routine calling */ y = 0; d = 0; m = 0;
h = 0; n = 0; s = 0; ms = 0;
/* encode/decode date and time values */ dtvalue = Util.EncodeDateTime(2023, 12, 5, 13, 12, 11, 10); Util.DecodeDateTime(dtvalue, y, d, m, h, n, s, ms);
dtvalue = Util.EncodeDate(2022, 11, 4); Util.DecodeDate(dtvalue, y, d, m);
dtvalue = Util.EncodeTime(12, 11, 10, 9); Util.DecodeTime(dtvalue, h, n, s, ms); end |