It looks like you're new here. Sign in or register to get started.
shettarvikas wrote: Hi, How can we convert a text(having integer values) to date.. eg: Text := 20081224 (YYYYMMDD) to date 12/24/2008 same way need to conver text to Time eg: Text = 192059 (hhmmss) to 19:20:59 Thanks & regards, Vikas
Comments
Simply..
datef : variable date type
EVALUATE(datef, COPYSTR(text,5,2)+'/'+COPYSTR(text,7,2)+'/'+COPYSTR(text,1,4));
LOL
Federico
MBS Specialist since NAV 2.0
My experiences on Linkedin
use following code.
year := copystr(datetext,1,4);
month := copystr(datetext,5,2);
day := copystr(datetext,7,2);
Evaluate(Dy,Day);
evaluate(mm,month);
evaluate(yy,year);
DesireDate := DMY2Date(mm,dy,yy);
for time
TextToTime(VarText : Text[8]) : Time
BaseVarTime := 111111T;
TimeSeparator := COPYSTR(FORMAT(BaseVarTime),3,1);
EVALUATE(VarTime,CONVERTSTR(VarText,':',TimeSeparator));
EXIT(VarTime);
Rajesh Patel
thanks both of u!!!