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     [CLOSED] DateTime field format manipulation needed *ddh*

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] DateTime field format manipulation needed *ddh*
 Login/Join
 
Silver Member
posted
How do I convert (i.e. functions to use) the following Datetime field formats
2011/09/07 11:48:22.000
TO
09/07/2011 11:48:22 AM.
It seems to reason there has to be a easy way to do this?? Any assistance is GREATLY APPRECIATED. I'm using WebFocus version 7.1.4 currently.

This message has been edited. Last edited by: Kerry,
 
Posts: 31 | Registered: November 17, 2005Report This Post
Master
posted Hide Post
quote:
How do I convert (i.e. functions to use) the following Datetime field formats
2011/09/07 11:48:22.000



quote:

TABLE FILE CAR
PRINT CAR MODEL

COMPUTE RAISETIME/HMDYYIA = DT(2011/09/07 11:48:22.000);
COMPUTE MYTEST/HHIA = RAISETIME;
END
-RUN


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Virtuoso
posted Hide Post
DEFINE FILE CAR
NEWDATE/HMDYYSA = DT(2011/09/07 11:48:22.0000;
END
TABLE FILE CAR
PRINT CAR NEWDATE
END
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
Well Tom - we hit that at the same time...
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Master
posted Hide Post
LOL, you have a syntax error.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
Denny99, as you can see, it is a simple case of setting a DEFINE or COMPUTE field to the format needed, then applying the datetime field.

This is because the format of the field indicated that its format is datetime, and what format to show it in.

You should have a look at the documentation on datetime fields, and the edit options for it.

Describe a Date-Time Field


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Thanks for all your replies but unfortunately none of these worked. First, our version of Webfocus is 7.1.4 and it didn't recognize the function HMDYYIA or HHIA. I can get the date portion to the format I want but when I try putting it all together with the time (minus the micro seconds 000) it doesn't work. It's important to get the AM or PM depending on the time of the day. The master file defines this field as partcular field as HYYMDs. Unfortunately, our environment is so locked down I'm unable to change this format. Thanks again for all those that replied.
 
Posts: 31 | Registered: November 17, 2005Report This Post
Expert
posted Hide Post
What did you try ?

All you should have to do is a DEFINE or COMPUTE
e.g.
DEFINE FILE ???
NEW_FIELD/HMDYYS = OLDFIELD ;
END


or

TABLE FILE ???
.
.
COMPUTE NEW_FIELD/HMDYYS = OLDFIELD ;
.
.
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Thanks for the recent reply WAZ. I tried just redefining the field and my results are close but I still can't get the "AM" or "PM" at the end of the date. Instead it's giving me 24hour time. I could write code to evaluate the time and manually adjust but I wouldn't think that would be necessary. Again, thanks so much for responding to my scream for help. Have a great day.
 
Posts: 31 | Registered: November 17, 2005Report This Post
Platinum Member
posted Hide Post
Hi,

Here's an example using CAR.

-*
DEFINE FILE CAR
CNT/I3 WITH COUNTRY = CNT + 1;
A_DTS/A14 = DECODE CNT (
1 '20110907114822'
2 '20110907120505'
ELSE '???');
END
-*
TABLE FILE CAR
PRINT
CNT
A_DTS
WHERE RECORDLIMIT EQ 2
ON TABLE HOLD
END
-*
DEFINE FILE HOLD
SD_DTS/HYYMDS = HINPUT(14, A_DTS, 8, 'HYYMDS');
-*
SD_DTS1/HYYMDs = SD_DTS;
SD_DTS2/HMDYYSA = SD_DTS;
END
-*
TABLE FILE HOLD
PRINT
CNT
A_DT
SD_DTS
SD_DTS1
SD_DTS2
END

Does this help?

Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report 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     [CLOSED] DateTime field format manipulation needed *ddh*

Copyright © 1996-2020 Information Builders