Focal Point
Date format to String format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4511008331

September 11, 2004, 01:42 AM
Ringo
Date format to String format
I have a question to convert a date format (28/03/2004) to a string format (20040328). Is there any function or command to do this in WebFocus?
September 11, 2004, 04:12 PM
jimbo
If the format of the field is "DMYY" then create a define such as this.
DEFINE FILE CAR
DATE1/A8DMYY = YOURDATEFIELD ;
DATE2/A8 = EDIT(DATE1,'$$$$9999') | EDIT(DATE1,'$$99') | EDIT(DATE1,'99') ;
END

Now you will have am Alphanumeric(text) field that is in YYYYMMDD order.
September 12, 2004, 09:15 AM
Ringo
Thank you very much. It works fine !
September 14, 2004, 05:55 PM
susannah
or, using the DATECVT function which
changes the form of your smart date...

temp/YYMD = DATECVT(yourdate,'DMYY','YYMD' );
temp1/A8DMYY = temp;
RESULTDATE/A8 = temp1;
produces...
MYDATE.....temp..........temp1........RESULTDATE
13/09/2004 2004/09/13 2004/09/13 20040913