Focal Point
[SOLVED]How to get today's date in different formats in header and footer

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

May 20, 2016, 07:52 AM
info4pal
[SOLVED]How to get today's date in different formats in header and footer
Hi,


Iam trying to get the today's date in the header as May 20, 2016 @ 07:15 which is in EST time zone and today's date in the footer(get it displayed in the footer) as Fri May 20 07:15:16 EDT 2016 but Iam unable to get it using HGETC function or others too...

Could anyone please let me know how this can be achieved.

Thanks a lot in advance!

Regards,
IP

This message has been edited. Last edited by: <Emily McAllister>,
May 20, 2016, 08:43 AM
MartinY
Can you provide what you did already (code) ?

Have you defined two variables (one for Heading and one for Footing) with different format ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
May 20, 2016, 09:38 AM
info4pal
Hi,

Iam trying to use like this :
-SET &HEADER_1 ='&DATEYYMD';
-SET &FOOTER_1 = '&DATEYYMD';

TABLE FILE CAR
PRINT *
HEADING
&HEADER_1
FOOTING
&FOOTER_1
END

but Iam not getting in the format as Iam expecting....

Please let me know how can this be achieved.

Thanks!
May 20, 2016, 09:49 AM
Ricardo Augusto
Where is the HGETC?

If you want to play with DATE variables, pick one of this:

-TYPE &|DATE           : &DATE
-TYPE &|DATED          : &DATED
-TYPE &|DATEDMtrYY     : &DATEDMtrYY
-TYPE &|DATEDMY        : &DATEDMY
-TYPE &|DATEDMYY       : &DATEDMYY
-TYPE &|DATEDwMtrYY    : &DATEDwMtrYY
-TYPE &|DATEJ          : &DATEJ
-TYPE &|DATEJUL        : &DATEJUL
-TYPE &|DATEM          : &DATEM
-TYPE &|DATEMDwtYY     : &DATEMDwtYY
-TYPE &|DATEMDWtrY     : &DATEMDWtrY
-TYPE &|DATEMDY        : &DATEMDY
-TYPE &|DATEMDYY       : &DATEMDYY
-TYPE &|DATEMt         : &DATEMt
-TYPE &|DATEMT         : &DATEMT
-TYPE &|DATEMtDwY      : &DATEMtDwY
-TYPE &|DATEMtrDYY     : &DATEMtrDYY
-TYPE &|DATEMtrDwtYY   : &DATEMtrDwtYY
-TYPE &|DATEMTDWTRYY   : &DATEMTDWTRYY
-TYPE &|DATEMtr        : &DATEMtr
-TYPE &|DATEMTr        : &DATEMTr
-TYPE &|DATEMTR        : &DATEMTR
-TYPE &|DATEMTRDwY     : &DATEMTRDwY
-TYPE &|DATEMTRDY      : &DATEMTRDY
-TYPE &|DATEMTY        : &DATEMTY
-TYPE &|DATEMTrYY      : &DATEMTrYY
-TYPE &|DATEMY         : &DATEMY
-TYPE &|DATEMYY        : &DATEMYY
-TYPE &|DATEQ          : &DATEQ
-TYPE &|DATEQY         : &DATEQY
-TYPE &|DATEQYY        : &DATEQYY
-TYPE &|DATEW          : &DATEW
-TYPE &|DATEwJ         : &DATEwJ
-TYPE &|DATEWJ         : &DATEWJ
-TYPE &|DATEWt         : &DATEWt
-TYPE &|DATEWT         : &DATEWT
-TYPE &|DATEWtr        : &DATEWtr
-TYPE &|DATEWTr        : &DATEWTr
-TYPE &|DATEWTR        : &DATEWTR
-TYPE &|DATEY          : &DATEY
-TYPE &|DATEYBMBD      : &DATEYBMBD
-TYPE &|DATEYM         : &DATEYM
-TYPE &|DATEYMDWT      : &DATEYMDWT
-TYPE &|DATEYQ         : &DATEYQ
-TYPE &|DATEYY         : &DATEYY
-TYPE &|DATEYYQ        : &DATEYYQ
-TYPE &|DATEYMD        : &DATEYMD
-TYPE &|DATEYYJ        : &DATEYYJ
-TYPE &|DATEYYJUL      : &DATEYYJUL
-TYPE &|DATEYYM        : &DATEYYM
-TYPE &|DATEYYMD       : &DATEYYMD
-TYPE &|DATEYYMDW      : &DATEYYMDW
-TYPE &|DATEYYMtrD     : &DATEYYMtrD
-TYPE &|DATEYYMtrDW    : &DATEYYMtrDW

  



WebFOCUS 8.1.05 / APP Studio
May 20, 2016, 09:51 AM
MartinY
This will give you the date and time as a standard format, then it's yours to use date function and other IBI function to have it the format you want.
-*-SET &RUNDATE = EDIT(&YYMD,'9999/99/99');
-SET &RUNDATE = '&DATEYYMD';
-SET &RUNTIME = EDIT(&TOD,'99$:99$:99');

-SET &HEADER_1 = &RUNDATE || ' ' | &RUNTIME;
-SET &FOOTER_1 = &RUNDATE || ' ' | &RUNTIME;

TABLE FILE CAR
PRINT *
HEADING
"&HEADER_1.EVAL"
FOOTING
"&FOOTER_1.EVAL"
END



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
May 20, 2016, 10:02 AM
Ricardo Augusto
Good One


WebFOCUS 8.1.05 / APP Studio
May 23, 2016, 02:07 AM
info4pal
Hi,

Martin - Thanks for the format!It helped me Smiler

Richardo - I was able to get the DMY(Date Month Year Day) using the date comnands which you had given above...Can you please let me know how can I get the time too using the same formats ?

Thanks a lot in advance!

Regarda!
May 24, 2016, 01:32 AM
info4pal
Hi,


Richardo - I used the set variable for Time and used it along with one of the date formats which you had mentioned....
It worked!! Thanks a lot again Smiler

Regards,
IP