![]() #FREE PASCAL CONVERT TIMESTAMP TO DATE HOW TO# Want more Presto tips & tricks? Sign up for our Presto community newsletter.I used to parse date string "Tue " in an e-mail message using VarToDateTime() which served its purpose well. ![]() Now, format changed to "Sunday, 22 September 2019" and that function is not so helpful as before. I am trying not to manually parse the string as it is due to change in the future, too.ġ- It is always possible one cannot see a simple solution. I appreciate if you can point me to right existing Delphi solution. I could not make StrToDate() working for me even with TFormatSettings provided and even with several different input strings like "22 September 2019", "22/September/2019", etc.Ģ- It would be great if anybody have a unit or a function he/she can share which handles provided date format like 'dddd, dd mmmm yyyy' and convert the input string to TDateTime using that given format. I do not know C#. I saw several examples of DateTime.ParseExact() which seems like what I am searching for. I might be completely wrong about that though. Shared C# code conversion is out of my league. ![]() I would vote for such a function to be implemented in Delphi by Embarcadero though.įor now, I have written something as following. I might improve this code to have time part and to handle my possible fail cases in the future. I am not after very fast code at the moment. TDateTimeHelper = record helper for TDateTime public class function ParseExact ( const Value, Format : string AFormatSettings : TFormatSettings ): TDateTime static end #FREE PASCAL CONVERT TIMESTAMP TO DATE CODE# #FREE PASCAL CONVERT TIMESTAMP TO DATE CODE#.#FREE PASCAL CONVERT TIMESTAMP TO DATE HOW TO#.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |