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 Time T Separator

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date Time T Separator
 Login/Join
 
Gold member
posted
I need my date time fields to have a T between date and time yyyy-mm-ddThh:mm:ss.

Example: 2016-04-01T13:45:23

I found a T separator option in the Help file:
- T applies the letter “T” as the separator.
Note: The T separator option is available for DateTime field formats (which is the U separator in the Master File), and enables recognition and output of the ISO standard format, where T is the delimiter between date and time.

I don't understand how to get it to work. Anyone use this before?

This message has been edited. Last edited by: Mikey,


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Master
posted Hide Post
Mikey, if you come to my desk, I'll let you borrow my "1001 Ways to Work with DATES in WebFOCUS" book..



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
Here are some high level tips..

-TYPE .
-TYPE Using EDIT()
-* Date formatting
-SET &FROM_DATE = '30/12/2015';
-SET &DATE1 = EDIT(&FROM_DATE,'$$$99') | '/' | EDIT(&FROM_DATE,'99') | '/' | EDIT(&FROM_DATE,'$$$$$$9999');
-TYPE FROM_DATE = >&FROM_DATE<
-TYPE DATE1 = >&DATE1<

-TYPE .
-TYPE Using EDIT()
-SET &FROM_DATE = '20160501';
-SET &DATE1 = EDIT(&FROM_DATE,'$$$$99') | '/' | EDIT(&FROM_DATE,'$$$$$$99') | '/' | EDIT(&FROM_DATE,'9999');
-TYPE FROM_DATE = >&FROM_DATE<
-TYPE DATE1 = >&DATE1<

-TYPE .
-TYPE Using EDIT()
-SET &FROM_DATE = '2016-01-17T00:00:00';
-SET &DATE1 = EDIT(&FROM_DATE,'9999') | '/' | EDIT(&FROM_DATE,'$$$$$99') | '/' | EDIT(&FROM_DATE,'$$$$$$$$99');
-TYPE FROM_DATE = >&FROM_DATE<
-TYPE DATE1 = >&DATE1<

-TYPE .
-TYPE Using HGETC(), HDIFF(), FPRINT()
-SET &DT1 = HGETC(8, 'HYYMD-s');
-SET &SLP = SLEEP(1.3, 'I4');
-SET &DT2 = HGETC(8, 'HYYMD-s');
-SET &DTDIFF = HDIFF(&DT2, &DT1, 'MILLISECOND', 'I8');
-SET &DT1 = FPRINT(&DT1, 'HYYMD-s', 'A23');
-SET &DT2 = FPRINT(&DT2, 'HYYMD-s', 'A23');

-TYPE DT1 = >&DT1<
-TYPE DT2 = >&DT2<
-TYPE DTDIFF = >&DTDIFF<
-RUN

-TYPE .
-TYPE Using DATEADD() -30
-SET &DT1 = &YYMD;
-SET &DT2 = (DATECVT((DATEADD((DATECVT(&DT1,'I8YYMD','YYMD')),D,-30)),'YYMD','I8YYMD'));
-TYPE DT1 = >&DT1<
-TYPE DT2 = >&DT2<



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
Try putting a 'U' between the date and time format components, and setting DTSTANDARD:
SET DTSTANDARD = ON
SET PAGE = OFF
DEFINE FILE CAR
-* Create a field in DATE-TIME Format.
 MIKEY/HYYMDS = DT(2005 DEC 26 05:45);
-* Convert format.  
 LIFECEREAL/HYYMDUS  = MIKEY;
END
TABLE FILE CAR
PRINT CAR NOPRINT 
      MIKEY 
      LIFECEREAL
IF RECORDLIMIT EQ 1
ON TABLE SET STYLEMODE FIXED
END  

MIKEY                LIFECEREAL                                               
-----                ----------                                               
2005-12-26 05:45:00  2005-12-26T05:45:00  
 
Posts: 822 | Registered: April 23, 2003Report This Post
Gold member
posted Hide Post
This is what I was missing
SET DTSTANDARD = ON
Thank you!


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Master
posted Hide Post
quote:
SET DTSTANDARD = ON
SET PAGE = OFF
DEFINE FILE CAR
-* Create a field in DATE-TIME Format.
MIKEY/HYYMDS = DT(2005 DEC 26 05:45);
-* Convert format.
LIFECEREAL/HYYMDUS = MIKEY;
END
TABLE FILE CAR
PRINT CAR NOPRINT
MIKEY
LIFECEREAL
IF RECORDLIMIT EQ 1
ON TABLE SET STYLEMODE FIXED
END





- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Gold member
posted Hide Post
This is not working when I use EXL07 output


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Master
posted Hide Post
We don't do a lot of MS Excel output; when we do we use FORMAT EXL2K.

When I added 'ON TABLE PCHOLD FORMAT EXL2K' to the model code the data appeared fine in Excel 2013.

This message has been edited. Last edited by: David Briars,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Gold member
posted Hide Post
I forgot about the EXL07 output getting different results with certain code. I bumped the HYYMDUS code up to a HOLD table and the T is there in my output table.

COMPUTE EVNT_ACT_DTTM/A20 = HCNVRT(EVENT_ACTUAL_DTTM, '(HYYMDUS)', 20, 'A20');

Mikey Likes It!


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report 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 Time T Separator

Copyright © 1996-2020 Information Builders