Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Date Conversion

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date Conversion
 Login/Join
 
Gold member
posted
I have the ORDATE stored in P8.0 and ORDTME stored in P6.0 format. I need to convert it to DATETIME format MM/DD/YYYY 24HH:MI:SS. I tried the following but it outputs milliseconds as well - Would appreciate if someone could help with this. Thanks.


DATE1/A8 = EDIT(ORDATE, '$99999999');
TIME1/A6 = EDIT(ORDTME, '$999999');
ALPHA_DATE_TIME/A15 = DATE1 | TIME1;
ORDER_DATETIME/HMDYYS = HINPUT(14, ALPHA_DATE_TIME, 8, 'HMDYYS');

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Expert
posted Hide Post
Interestingly, I don't get the milliseconds with HMDYYS, and do get them with HMDYYs. Example code:
DEFINE FILE CAR
DATE1/A8 = '&YYMD';
TIME1/A6 = EDIT('&TOD','99$99$99');

ALPHA_DATE_TIME/A15 = DATE1 | TIME1;
ORDER_DATETIME1/HMDYYS = HINPUT(14, ALPHA_DATE_TIME, 8, 'HMDYYS');
ORDER_DATETIME2/HMDYYs = HINPUT(14, ALPHA_DATE_TIME, 8, 'HMDYYs');
END

TABLE FILE CAR
PRINT
ORDER_DATETIME1
ORDER_DATETIME2
BY COUNTRY
WHERE RECORDLIMIT EQ 1
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Thanks Francis. I do not get the milliseconds in the display but if I do APP HOLD and hold it as a table (which I need to do), then there are two problems
1. It is stored as 20150101082924000 when I need it to be stored as 01012015... i.e. MDYY
2. There are those three 0s at the end for milliseconds.

I am doing APP HOLD and then ON TABLE HOLD FORMAT DFIX DELIMITER |

Any solutions?


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Expert
posted Hide Post
One way would be using FPRINT to convert to alpha and then use an EDIT mask to retain only those characters in which you are interested.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
texgator, it would be nice if the whole problem was described in the original post. As Tony mentions, you can use FPRINT and EDIT:

SET HOLDLIST=PRINTONLY

DEFINE FILE CAR
DATE1/A8 = '&YYMD';
TIME1/A6 = EDIT('&TOD','99$99$99');

ALPHA_DATE_TIME/A15 = DATE1 | TIME1;
ORDER_DATETIME1/HMDYYS = HINPUT(14, ALPHA_DATE_TIME, 8, 'HMDYYS');
ORDER_DATETIME2/HMDYYs = HINPUT(14, ALPHA_DATE_TIME, 8, 'HMDYYS');
END

TABLE FILE CAR
PRINT
-*ORDER_DATETIME1
-*ORDER_DATETIME2
COMPUTE ORDER_DATETIME3TEMP/A19 = FPRINT(ORDER_DATETIME1, 'HYYMDS', 'A19'); NOPRINT
COMPUTE ORDER_DATETIME3/A14 = EDIT(ORDER_DATETIME3TEMP,'9999$99$99$99$99$99');
BY COUNTRY
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD
END

?FF HOLD

TABLE FILE HOLD
PRINT *
END

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Thanks much Francis and Tony for your help. The issue has been resolved.


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Date Conversion

Copyright © 1996-2020 Information Builders