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.
Anyone know a routine to convert Military time to AM/PM. The only thing I've been able to find is a routine that takes the System Time and I can't seem to trick into taking my field instead of the System Time. Here's the routine that does that. CURRENT_TIME2/HHISA= HGETC(8,'HHISA');
I just have a field that is Time/A8 - 13:00:00 and I need it to print 01:00:00AM
Thanks
Prarie
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
First off on the 24 hour clock, 13:00 is 1:00 PM sorry couldn't resist.
I looked through functions and found nothing, but:
Check if you first field is gt 12 if it is then subtract 12 from it and put the PM on the end.
Of course first you'd have to convert the first two digits to a number using EDIT then tack it all back when complete.
HDIG/I2 = EDIT (TMFLD,'99'); HDIG/I2 = IF HDIG GT 12 THEN HDIG - 12 ELSE HDIG; ADIG/A2 = EDIT(HDIG); AMPM/A2 = IF HDIG GT 12 THEN 'PM' ELSE 'AM'; NEWTIME/A10 = ADIG | EDIT (MFLD,'$$999999') | APPM;
Of course the above hasn't been syntax checked. And what happens if it is 24:00:00, or is it 00:00:00 for midnight on the sytem? Also, for 12:00:00 which is noon do you code it as am or pm.
Such a tangled web when you start discussing how to do time.
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
I just had figured out this...which is basically what you were saying...after I figured there just was not going to be a neat function to do this for me. Now they have one that converts time to Midnight - HMIDNT...but not Military time go figure.
HRS1/I2 = EDIT(HRS); HRS2/I2 = IF HRS1 GT 12 THEN HRS1 - 12 ELSE HRS1; HRS3/A2 = EDIT(HRS2); AM/A2 = IF HRS1 GT 12 THEN 'PM' ELSE 'AM';
NEWTIME/A7 = HRS3 | ':' | MIN | AM;
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
&TOD is the system variable that prints in 24hour time. 13.40.55 is 1:40 and 55 secs . Do you have timestamps as data fields in a file that you have to work with? or are you starting from scratch with system time? I thought military time was gmt always, regardless of where you were in the world. We have a way to extract your gmt offset from your reg.exe, if you're going that route. (nb: win2k server)
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
No actually this is a time field that is stored I4 on a Help Call Center file, as a time a call was recorded. So it reads 0245...that is really saying 2:45...and 1300 is 13:00. So had to take and split into two. Rightside - Leftside.. concatenate it in to a Military time ...have no clue why it is like this...but that's what I have to work with...so I've converted it to a time and then did the little routine above...and seems to be working... Hope that makes sense.
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
NEWTIMEI4/I4 = IF TIMEFIELD GE 1300 THEN TIMEFIELD - 1200 ELSE TIMEFIELD; NEWTIMEA4/A4 = EDIT(NEWTIMEI4); NEWTIME/A8 = IF TIMEFIELD LT 1000 THEN EDIT(NEWTIMEA4, ' $9:99 AM') ELSE IF TIMEFIELD LT 1200 THEN EDIT(NEWTIMEA4, '99:99 AM') ELSE IF TIMEFIELD LT 1300 THEN EDIT(NEWTIMEA4, '99:99 PM') ELSE IF TIMEFIELD LT 2000 THEN EDIT(NEWTIMEA4, ' $9:99 PM') ELSE EDIT(NEWTIMEA4, '99:99 PM'); Don't know of any function but this should work replace TIMEFIELD with your actual field.This message has been edited. Last edited by: <Mabel>,
My timefield is format of Char 8 in the real database. I am trying to use this suggestion but it is not working. Any suggestions? NEWTIMEI4/I4 = IF TIMEFIELD GE 1300 THEN TIMEFIELD - 1200 ELSE TIMEFIELD; NEWTIMEA4/A4 = EDIT(NEWTIMEI4); NEWTIME/A8 = IF TIMEFIELD LT 1000 THEN EDIT(NEWTIMEA4, ' $9:99 AM') ELSE IF TIMEFIELD LT 1200 THEN EDIT(NEWTIMEA4, '99:99 AM') ELSE IF TIMEFIELD LT 1300 THEN EDIT(NEWTIMEA4, '99:99 PM') ELSE IF TIMEFIELD LT 2000 THEN EDIT(NEWTIMEA4, ' $9:99 PM') ELSE EDIT(NEWTIMEA4, '99:99 PM');
awwww Thanks...how nice. This was originally posted by me in 2005...and LOgle did their search...and was asking another quetion. But I did go back and look at my program...to make sure I had the correct number Glenda!!
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005