Hy
I have this C/AL for a date format:
txtFormatString := ‘<Day,2>/<Month,2>/<Year,2>’;
FechaSincronizacion2 := recSalesReceivables.“Last date import”;
FechaSincronizacion := FORMAT(FechaSincronizacion2,0,txtFormatString);
and the result is = 24/05/10
But I want the date format to be like: 24/05/2010
If I change this C/AL line
txtFormatString := ‘<Day,2>/<Month,2>/<Year,2>’; to txtFormatString := ‘<Day,2>/<Month,2>/<Year,4>’;
The the result is = 24/05/0010
How can I do It??
Hi Luna
use DATE2MY function like below
d := TODAY;
day := DATE2DMY(d,1);
month := DATE2DMY(d,2);
year := DATE2DMY(d,3);
MESSAGE(Text000,day,month,year); """ *instead of this message concatinate your result """""*
*Thanks*
*Jerome Marshal.J*
admin1
May 27, 2010, 10:20am
3
Hi Luana,
Try with instead of <Year,4>.
use DATE2MY function like below
d := TODAY; day := DATE2DMY(d,1); month := DATE2DMY(d,2); year := DATE2DMY(d,3); MESSAGE(Text000,day,month,year); “”" instead of this message concatinate your result “”“”"
Thanks
Jerome Marshal.J
[:^)] - never seen this solution before…
stan
September 1, 2010, 8:10am
6
how to get now??
FORMAT(TODAY,0,’<Month,2><Day,2>’) → today
how to get like this 01012010123055 → date + time
thanks
DaveT
September 1, 2010, 9:07am
7
Hi Stan,
Try,
FORMAT(,0,’<Day,2><Month,2><Minutes,2><Seconds,2>’)
Look at the help for “Format Property”
stan
September 1, 2010, 9:23am
8
yeah yeah… i already see the format property
i use this FORMAT(TODAY,0,’<Month,2><Day,2><Minutes,2><Seconds,2>’)
but it was said invalid format property
DaveT
September 1, 2010, 9:29am
9
Hi Stan,
Sorry I should have put in
FORMAT(CURRENTDATETIME,0,’<Day,2><Month,2><Minutes,2><Seconds,2>’)
TODAY - is a date function whereas
CURRENTDATETIME - is a datetime function.
Dave,it works !!!
thanks for your help
Stan for more details you can check it out following thing.
Open Classic Client than go to help and select C/SIDE Reference Guide… In this search for FORMAT Property . You will find that how to FORMAT method for available DataTypes .