date format TODAY to DDMMMYY

DEFINE VARIABLE months AS CHARACTER NO-UNDO INIT "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec".
MESSAGE PROGRAM-NAME(1) SKIP
STRING(DAY(TODAY)) + CAPS(ENTRY(MONTH(TODAY),months)) + SUBSTR(STRING(YEAR(TODAY)),3)
VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "DEBUG".
 
Hi bulklodd,
my good friend , thanks again. It works but i have a question.
I want to see date as 06OCT05, after printing i can see only
6OCT05 the "0" is missing. PLease help.Many Thanks.
 
I want to see date as 06OCT05, after printing i can see only
6OCT05 the "0" is missing. PLease help.Many Thanks.

Here's a snippet:

DEFINE VARIABLE months AS CHARACTER NO-UNDO INIT "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec".
MESSAGE PROGRAM-NAME(1) SKIP
STRING(DAY(TODAY),"99") + CAPS(ENTRY(MONTH(TODAY),months)) + SUBSTR(STRING(YEAR(TODAY)),3)
VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "DEBUG".
 
This is a startup parameter. You should have a -dmy with the format you require. This effects the WHOLE session of that Progress. Though you could as a work around convert via string.
 
This is a startup parameter. You should have a -dmy with the format you require. This effects the WHOLE session of that Progress. Though you could as a work around convert via string.

You can do it at runtime with the use of

Code:
SESSION:DATE-FORMAT = "dmy".
 
To get the 0 before the six you just have to put a format phrase in the example bulkodd gave:

e.g.

Code:
DEFINE VARIABLE months AS CHARACTER NO-UNDO INIT "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec".
MESSAGE 
STRING(DAY(TODAY),'99') + CAPS(ENTRY(MONTH(TODAY),months)) + SUBSTR(STRING(YEAR(TODAY)),3)
VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "DEBUG".

Casper.
 
Casper said:
To get the 0 before the six you just have to put a format phrase in the example bulkodd gave:

e.g.

Code:
DEFINE VARIABLE months AS CHARACTER NO-UNDO INIT "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec".
MESSAGE 
STRING(DAY(TODAY),'99') + CAPS(ENTRY(MONTH(TODAY),months)) + SUBSTR(STRING(YEAR(TODAY)),3)
VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "DEBUG".

Casper.
Hi Guys,

Thanks all for their help especially bulkodd and casper.My program works very well. Thanks.
 
there are several date formats predefines in the the session varable for Date-Format i would check those out too.

Session:Date-Format = "DDMMYYYY"

Don't know if that is valid or not but check into it. I was giving and example to look at what i meant.
 
Back
Top