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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Hours and Seconds
 Login/Join
 
<Mirza>
posted
Hello,

I was wondering if anyone knows of a technique or function to convert seconds to minutes:seconds.

For example, when a field contains 129 seconds, the output should produce 2:09.

Thanks in advance!
 
Report This Post
Expert
posted Hide Post
Ideally, it would be done using the HHIS date-time format, which a Time only format, HH:MM:SS.

This example puts the current time in the HHIS field:

DEFINE FILE CAR
TIMEX/HHIS = HGETC(8,'HHIS')
END
TABLE FILE CAR
PRINT MODEL TIMEX
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF,
FONT='VERDANA', SIZE=8, $
ENDSTYLE
END

I absolutely cannot figure out how to get a numeric field that contains seconds into the HHIS field.

My solution:

DEFINE FILE CAR
SECONDS/I4 = 129;
TIME_MM/I2 = SECONDS / 60;
-* IMOD(DIVIDEND, DIVISOR, OUTFIELD)
TIME_SS/I2 = IMOD(SECONDS, 60,'I2') ;
TIME_MMSS/A5 = EDIT(TIME_MM) | ':' | EDIT(TIME_SS);
END
TABLE FILE CAR
PRINT MODEL SECONDS TIME_MM TIME_SS TIME_MMSS
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF,
FONT='VERDANA', SIZE=8, $
ENDSTYLE
END
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Jack Gross gave me this routine back in February


hhmmss/I6= INT( seconds/3600 ) * 10000 + INT( IMOD(seconds,3600,'I4')/60 ) * 100 + IMOD(seconds,60,'I2');time/A8=EDIT(hhmmss,'99:99:99');
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
ooooo. that's sweeeeeet. Thanks for sharing that, Prairie.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders