I use DateTime fields all over the place but I guess I've never needed to set the value to anything other than .now.
How can I set a dateTime fields value? This doesn't work:
myDateTime := '2000-01-01-00.00.00' The IDE says datetime field can't be set to string. .asDateTime isn't a valid intrinsic for a literal. In RPG you can use d'2000-01-01-00.00.00'
Set the value of a DateTime in VL?
Set the value of a DateTime in VL?
Art Tostaine
Re: Set the value of a DateTime in VL?
Hi Art
Like this:
in your example you have an extra -
Like this:
Code: Select all
#DATETIMEX := '2023-02-28 01:02:03.004'
* Or this: #DATETIMEX := '2023-02-28'
* Or this: #DATETIMEX := '2023-02-28 13:20'
#Edit1.Value := #DATETIMEX.AsStringCode: Select all
'2000-01-01 - 00.00.00' Re: Set the value of a DateTime in VL?
Thanks. It displays with the - on the IBM i. I wonder how other DB's display the value?
Art Tostaine
Re: Set the value of a DateTime in VL?
More details are here. but that is the format that LANSA uses to convert to datetime.
once a datetime field, you dont really care about how the database stores it inside.
only one other thing to be aware is time zones.
more detail here:
https://docs.lansa.com/15/en/lansa015/c ... 1_0070.htm
once a datetime field, you dont really care about how the database stores it inside.
only one other thing to be aware is time zones.
more detail here:
https://docs.lansa.com/15/en/lansa015/c ... 1_0070.htm