Focal Point
[SOLVED] Date format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/514105243

January 15, 2010, 12:32 PM
ramakrk
[SOLVED] Date format
Hi
I am using &DATEtMDYY for current date in Report Header. It is giving Jan25,2010. But i need a format like this: 11/10/2009 11:17am. i.e Timestamp.Any help would be appreciated. HTML output,report painter,DB2 stored procedure.
thanks,
rama

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


WebFOCUS 762
Windows
To be decided(All formats)
January 15, 2010, 12:44 PM
GinnyJakes
This:
-TYPE &DATEMDYY &TOD
gives you this:
01/15/2010 11.44.09

You can parse &TOD to add the am or the pm.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 15, 2010, 01:04 PM
njsden
You may also try:

-SET &CURRDTTM = HCNVRT(HGETC(10, 'HYYMDSA'), '(HMDYYSA)', 25, 'A25');
-TYPE &CURRDTTM


Which will give you:

01/15/2010 12:48:07PM


Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
January 15, 2010, 01:05 PM
ramakrk
Ginny,
That is a real and timely help. Thank you so much.
rama


WebFOCUS 762
Windows
To be decided(All formats)
January 15, 2010, 01:33 PM
ramakrk
Hi Neftali,
Yours is fantastic.
thanks for the help,
rama


WebFOCUS 762
Windows
To be decided(All formats)
January 19, 2010, 08:51 AM
Doug
One step beyond that, add the following to get
01/19/2010  8:48am

-SET &CURRDTTM = EDIT(&CURRDTTM,'9999999999999999$$$99') ;
-SET &CURRDTTM = LOCASE(18,'&CURRDTTM.EVAL',&CURRDTTM) ;
I showed this in two steps (EDIT and LOCASE) for simplicity. Combine them as desired...




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
January 20, 2010, 09:28 AM
DavSmith
With a small modification, you will get the same effect on a single line of code by changing the code to read:

quote:
-SET &CURRDTTM = HCNVRT(HGETC(10, 'HYYMD'), '(HMDYYIa)', 25, 'A25');
-TYPE &CURRDTTM


displays as:

01/20/2010 8:20am

And for fancier kicks, another small change
quote:
-SET &CURRDTTM = HCNVRT(HGETC(10, 'HYYMD'), '(HMTDYYIa)', 25, 'A25');
-TYPE &CURRDTTM


will get you:

January 20 2010 8:24am



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
January 24, 2010, 08:21 PM
ramakrk
Hi Dav smith,
Thanks for the reply. I need to display 01/20/2010 in line one and timestamp 8.24AM is on second line.i.e at two different places.How can i do it with your code.Thanks for a kind help,
rama


WebFOCUS 762
Windows
To be decided(All formats)
January 25, 2010, 02:10 AM
Tony A
You're kidding right? The output from Dav's suggestion is a single alphanumeric (A25) variable it should be quite easy to work out how to split it into two variables from one.

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