Page 1 of 1

DATE formatting

Posted: Mon Oct 09, 2017 8:49 pm
by kno_dk
Hi.

I have an old WEBEVENT (RDMLX) function where we have a date in a list. Today the format is yyyy.mm.dd. Now the customer want it to be dd.mm.yy and they want to keep the leding zero eg 09-10-17. I have created a virtual field tha make the conversion of the data and The field have the Y edit code. It removes the leding zero.
Can I do it with the some kind of formatting the <RDML MERGE="KWORDDV6" FORMAT=4>, edit word(would that work in web) or do anybody have a better solution (some RDMLX code that move the date into a string)?

/Klaus

Re: DATE formatting

Posted: Wed Oct 11, 2017 11:02 pm
by HMJust
If you are just looking for data to string, this has worked for me:

Code: Select all

Define Field(#HMJDATE) Type(*DATE)
#HMJDATE := *YYMMDD
#WCHAR8 := #HMJDATE.AsString.Substring( 9 2 ) + '-' + #HMJDATE.AsString.Substring( 6 2 ) + '-' + #HMJDATE.AsString.Substring( 3 2 )