Page 1 of 1

Current Date in RDML

Posted: Mon Jan 02, 2023 7:30 pm
by sotis
Hello,

is there any way to get the current date in ISO format only with RDML (no RDMLX)?

e.g.
Define Field(#CURDATE) TYPE(*CHAR) LENGTH(10) DEFAULT('''2023-01-02''')

note TYPE(*DATE) wont work for RDML

thanks,
Sotiris

Re: Current Date in RDML

Posted: Tue Jan 03, 2023 1:54 am
by adale
Sotiris,
The BIF ConvertDate might be what you are looking for (review the date format codes).
https://docs.lansa.com/15/en/lansa015/c ... RTDATE.htm

Here are a couple ideas to work with:

* quick test work for forum date question
Define Field(#CURDATEN) Type(*DEC) Length(8) Decimals(0)
Define Field(#CURDATEA) Type(*CHAR) Length(10) Default('''2023-01-02''')
Define Field(#wk_DATE) Type(*CHAR) Length(10)


* as a numeric value:
Change Field(#CURDATEN) To(*YYYYMMDD)


* as a character value
Use Builtin(NUMERIC_STRING) With_Args(#CURDATEN) To_Get(#wk_DATE)
Use Builtin(CONVERTDATE) With_Args(#wk_DATE J K) To_Get(#CURDATEA)


* or manually
* as a character value with " - " separator
Change Field(#CURDATEA) To('''----------''')
Substring Field(#WK_DATE 1 4) Into_Field(#CURDATEA)
Substring Field(#WK_DATE 5 2) Into_Field(#CURDATEA 6 2)
Substring Field(#WK_DATE 7 2) Into_Field(#CURDATEA 9 2)