Problem in Extracting the Tdatetime

Please discuss general Delphi programming topics here.

Problem in Extracting the Tdatetime

Postby sekar1 » September 11th, 2007, 1:45 pm

i av a string like this 8/14/07 8:04:07 PM. i need to write the function for changing this into Tdatetime variable. What i did is, extract the Tdate and Ttime seperately and finally combined that. Here is the code.
Templist:= Tstringlist.Create;
Templist.Delimiter := #9;
Templist.DelimitedText:= '8/14/07 8:04:07 PM';
Dstr:= Templist[5];
Tstr:= Templist[6]+Templist[7];
Date:= Strtodate(Dstr);
Time:= Strtotime(Tstr);
Result:= Int(Date) + Frac(Time) ;
the values of the templist[5],[6],[7] are given.

But the application is of used across the globe and i got the bug that this is not suitable all the regional setting for windows, and they asked me to set temporary Tformatsettings.
i am not able to know how to proceed. do anyone post suggestions in this matter?
Junior Member
Junior Member
Posts: 25
Joined: December 21st, 2006, 5:55 am

Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest