DATE formatting

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Posts: 131
Joined: Tue Feb 23, 2016 12:00 am

DATE formatting

Post by kno_dk » Mon Oct 09, 2017 8:49 pm


I have an old WEBEVENT (RDMLX) function where we have a date in a list. Today the format is Now the customer want it to be 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)?


User avatar
Posts: 51
Joined: Wed May 11, 2016 7:23 pm

Re: DATE formatting

Post by HMJust » Wed Oct 11, 2017 11:02 pm

If you are just looking for data to string, this has worked for me:

Code: Select all

Define Field(#HMJDATE) Type(*DATE)
#WCHAR8 := #HMJDATE.AsString.Substring( 9 2 ) + '-' + #HMJDATE.AsString.Substring( 6 2 ) + '-' + #HMJDATE.AsString.Substring( 3 2 )
I don't know what I am doing, nor how I did it. If it works, luck was involved :geek:

Post Reply